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 
13 #include <atomic>
14 
15 namespace edm {
16  class ActivityRegistry;
17  class Event;
18  class EventSetup;
19  class ParameterSet;
21  class StreamContext;
22  class ModuleCallingContext;
23 
24  namespace service {
25  class Timing : public TimingServiceBase {
26  public:
28  ~Timing();
29 
30  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
31 
32  virtual void addToCPUTime(StreamID id, double iTime) override;
33 
34  private:
35 
36  void postBeginJob();
37  void postEndJob();
38 
39  void preEvent(StreamContext const&);
40  void postEvent(StreamContext const&);
41 
42  void preModule(StreamContext const&, ModuleCallingContext const&);
43  void postModule(StreamContext const&, ModuleCallingContext const&);
44 
45  double curr_job_time_; // seconds
46  double curr_job_cpu_; // seconds
47  //use last run time for determining end of processing
48  std::atomic<double> last_run_time_;
49  std::atomic<double> last_run_cpu_;
50  std::vector<double> curr_events_time_; // seconds
53 
54  //
55  // Min Max and total event times for each Stream.
56  // Used for summary at end of job
57  std::vector<double> max_events_time_; // seconds
58  std::vector<double> min_events_time_; // seconds
59  std::vector<double> sum_events_time_;
60  std::atomic<unsigned long> total_event_count_;
61  };
62  }
63 }
64 
65 #endif
std::vector< double > sum_events_time_
Definition: Timing.h:59
double curr_job_time_
Definition: Timing.h:45
std::atomic< double > last_run_cpu_
Definition: Timing.h:49
std::vector< double > max_events_time_
Definition: Timing.h:57
bool report_summary_
Definition: Timing.h:52
std::vector< double > curr_events_time_
Definition: Timing.h:50
void postEvent(StreamContext const &)
Definition: Timing.cc:189
double curr_job_cpu_
Definition: Timing.h:46
Timing(ParameterSet const &, ActivityRegistry &)
Definition: Timing.cc:68
std::atomic< double > last_run_time_
Definition: Timing.h:48
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: Timing.cc:111
virtual void addToCPUTime(StreamID id, double iTime) override
Definition: Timing.cc:105
std::atomic< unsigned long > total_event_count_
Definition: Timing.h:60
void postModule(StreamContext const &, ModuleCallingContext const &)
Definition: Timing.cc:213
void preEvent(StreamContext const &)
Definition: Timing.cc:184
void preModule(StreamContext const &, ModuleCallingContext const &)
Definition: Timing.cc:208
std::vector< double > min_events_time_
Definition: Timing.h:58