00001 #ifndef Services_TIMING_h 00002 #define Services_TIMING_h 00003 // -*- C++ -*- 00004 // 00005 // Package: Services 00006 // Class : Timing 00007 // 00008 // Original Author: Jim Kowalkowski 00009 // 00010 00011 /* 00012 Changes Log 1: 2009/01/14 10:29:00, Natalia Garcia Nebot 00013 Modified the service to add some new measurements: 00014 - Average time per event (cpu and wallclock) 00015 - Fastest time per event (cpu and wallclock) 00016 - Slowest time per event (cpu and wallclock) 00017 */ 00018 00019 #include "DataFormats/Provenance/interface/EventID.h" 00020 #include "DataFormats/Provenance/interface/ProvenanceFwd.h" 00021 00022 namespace edm { 00023 class ActivityRegistry; 00024 class Event; 00025 class EventSetup; 00026 class ParameterSet; 00027 class ConfigurationDescriptions; 00028 00029 namespace service { 00030 class Timing { 00031 public: 00032 Timing(ParameterSet const&,ActivityRegistry&); 00033 ~Timing(); 00034 00035 static void fillDescriptions(edm::ConfigurationDescriptions & descriptions); 00036 00037 private: 00038 void postBeginJob(); 00039 void postEndJob(); 00040 00041 void preEventProcessing(EventID const&, Timestamp const&); 00042 void postEventProcessing(Event const&, EventSetup const&); 00043 00044 void preModule(ModuleDescription const&); 00045 void postModule(ModuleDescription const&); 00046 00047 EventID curr_event_; 00048 double curr_job_time_; // seconds 00049 double curr_job_cpu_; // seconds 00050 double curr_event_time_; // seconds 00051 double curr_event_cpu_; // seconds 00052 double curr_module_time_; // seconds 00053 double total_event_cpu_; // seconds 00054 bool summary_only_; 00055 bool report_summary_; 00056 00057 // 00058 // Min Max and average event times for summary 00059 // at end of job 00060 double max_event_time_; // seconds 00061 double max_event_cpu_; // seconds 00062 double min_event_time_; // seconds 00063 double min_event_cpu_; // seconds 00064 int total_event_count_; 00065 }; 00066 } 00067 } 00068 00069 #endif