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