Project

General

Profile

TimeTracker

Optional service

The TimeTracker service is entirely SQLite driven.

The allowed FHiCL configuration is as follows:

services: {
  TimeTracker: { 
    printSummary: true  # default
    dbOutput: {
      filename: "" # default
      overwrite: false  # default         
    }
  }
}

If printSummary is set to true, a printout will be generated and logged to whichever messagefacility destinations are enabled. A sample printout looks like this:

=============================================================================================================================
TimeTracker printout (sec)                     Min           Avg           Max         Median          RMS         nEvts   
=============================================================================================================================
Full event                                 0.000429609    0.0008353     0.0980797    0.000443806   0.00576163      1000    
-----------------------------------------------------------------------------------------------------------------------------
source:EmptyEvent(read)                    7.6241e-05    8.44886e-05   0.00146397     7.842e-05    4.50483e-05     1000    
p1:prod:TestTimeTrackerProducer            1.7364e-05    1.90632e-05   0.000634031   1.7982e-05    1.95145e-05     1000    
p1:filt:TestTimeTrackerFilter              1.1729e-05    1.35639e-05   0.000430082   1.2321e-05    1.52977e-05     1000    
p1:TriggerResults:TriggerResultInserter    0.000145421   0.000164609   0.00911097    0.000147956   0.000294405     1000    
end_path:mod1:TestTimeTrackerAnalyzer       5.418e-05    6.04836e-05   0.00291575    5.58275e-05   9.04527e-05     1000    
end_path:mod2:TestTimeTrackerAnalyzer       7.846e-06    8.86982e-06   2.6669e-05    8.5695e-06    1.22759e-06     1000    
=============================================================================================================================

where the full event timing measurements are given, as well as the per-module information below it. The identifiers are formatted by path_name:module_label:module_type, where the path_name value for any modules included in end_paths is simply 'end_path'.

The sqlite database output

[ For SQLite help, see here. ]

If a non-empty filename is specified in a user's FHiCL file, two tables that include all event-/module-level information--TimeEvent and TimeModule, respectively--are saved to the database file. The contents of TimeEvent and TimeModule look like (Time is in seconds):

Run         SubRun      Event       Time
----------  ----------  ----------  -----------
1           0           1           0.011055404
1           0           2           0.000993288
1           0           3           0.000582428
1           0           4           0.000511138
1           0           5           0.000511533
1           0           6           0.000515422
1           0           7           0.000525921
1           0           8           0.000531318
1           0           9           0.000497598
etc.

and

Run         SubRun      Event       Path        ModuleLabel  ModuleType               Time
----------  ----------  ----------  ----------  -----------  -----------------------  -----------
1           0           1           p1          prod         TestTimeTrackerProducer  0.000449457
1           0           1           p1          filt         TestTimeTrackerFilter    0.000279994
1           0           1           p1          TriggerResu  TriggerResultInserter    0.007013251
1           0           1           end_path    mod1         TestTimeTrackerAnalyzer  0.002244631
1           0           1           end_path    mod2         TestTimeTrackerAnalyzer  3.6157e-05
1           0           2           p1          prod         TestTimeTrackerProducer  5.1175e-05
1           0           2           p1          filt         TestTimeTrackerFilter    6.3662e-05
1           0           2           p1          TriggerResu  TriggerResultInserter    0.000475709
1           0           2           end_path    mod1         TestTimeTrackerAnalyzer  0.000118238
1           0           2           end_path    mod2         TestTimeTrackerAnalyzer  1.7232e-05
etc.

(Note that the truncation of the ModuleLabel values is due simply to a default width specification, which can be increased to show the entire name.) By retaining the database file, a user is able to further query the tables, extracting quantities to their own liking.

The overwrite option

A user may decide to run multiple TimeTracker processes sequentially with the intent of adding entries to the TimeEvent and TimeModule sqlite tables in an already-existing database. This behavior is enabled by default, and the time-report summaries logged by the messagefacility are automatically recomputed. If, however, a user wants a fresh set of tables for each executed TimeTracker process, the following can be specified in the user's FHiCL file:

services.TimeTracker.dbOutput.overwrite : true

The default setting

If a user simply specifies

TimeTracker : {}

within the services block of his/her FHiCL file, only the messagefacility printout will be outputted.

art-provided querying scripts

art provides SQLite scripts for the TimeTracker service for calculating various quantities of interest. See here for how to use them.