CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Timing.h
Go to the documentation of this file.
1 #ifndef Services_TIMING_h
2 #define Services_TIMING_h
3 // -*- C++ -*-
4 //
5 // Package: Services
6 // Class : Timing
7 //
8 // Original Author: Jim Kowalkowski
9 //
10 
12 #include <atomic>
13 
14 namespace edm {
15  class ActivityRegistry;
16  class Event;
17  class EventSetup;
18  class ParameterSet;
20  class StreamContext;
21  class ModuleCallingContext;
22 
23  namespace service {
24  class Timing {
25  public:
27  ~Timing();
28 
29  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
30 
31  private:
32 
33  void postBeginJob();
34  void postEndJob();
35 
36  void preEvent(StreamContext const&);
37  void postEvent(StreamContext const&);
38 
39  void preModule(StreamContext const&, ModuleCallingContext const&);
40  void postModule(StreamContext const&, ModuleCallingContext const&);
41 
42  double curr_job_time_; // seconds
43  double curr_job_cpu_; // seconds
44  std::vector<double> curr_events_time_; // seconds
45  std::vector<double> curr_events_cpu_; // seconds
46  std::vector<double> total_events_cpu_; // seconds
49 
50  //
51  // Min Max and average event times for each Stream.
52  // Used for summary at end of job
53  std::vector<double> max_events_time_; // seconds
54  std::vector<double> max_events_cpu_; // seconds
55  std::vector<double> min_events_time_; // seconds
56  std::vector<double> min_events_cpu_; // seconds
57  std::atomic<unsigned long> total_event_count_;
58  };
59  }
60 }
61 
62 #endif
double curr_job_time_
Definition: Timing.h:42
std::vector< double > max_events_time_
Definition: Timing.h:53
bool report_summary_
Definition: Timing.h:48
std::vector< double > curr_events_time_
Definition: Timing.h:44
void postEvent(StreamContext const &)
Definition: Timing.cc:192
double curr_job_cpu_
Definition: Timing.h:43
std::vector< double > curr_events_cpu_
Definition: Timing.h:45
std::vector< double > total_events_cpu_
Definition: Timing.h:46
Timing(ParameterSet const &, ActivityRegistry &)
Definition: Timing.cc:68
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: Timing.cc:107
std::atomic< unsigned long > total_event_count_
Definition: Timing.h:57
std::vector< double > max_events_cpu_
Definition: Timing.h:54
std::vector< double > min_events_cpu_
Definition: Timing.h:56
void postModule(StreamContext const &, ModuleCallingContext const &)
Definition: Timing.cc:221
void preEvent(StreamContext const &)
Definition: Timing.cc:186
void preModule(StreamContext const &, ModuleCallingContext const &)
Definition: Timing.cc:216
std::vector< double > min_events_time_
Definition: Timing.h:55