CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ThroughputService.h
Go to the documentation of this file.
1 #ifndef ThroughputService_h
2 #define ThroughputService_h
3 
4 // C++ headers
5 #include <string>
6 #include <chrono>
7 #include <functional>
8 
9 // TBB headers
10 #include <tbb/concurrent_unordered_map.h>
11 #include <tbb/concurrent_unordered_set.h>
12 
13 // ROOT headers
14 #include <TH1F.h>
15 
16 // CMSSW headers
28 
29 // based on clock_gettime(CLOCK_MONOTONIC, ...)
31 {
33  typedef duration::rep rep;
34  typedef duration::period period;
35  typedef std::chrono::time_point<clock_gettime_monotonic, duration> time_point;
36 
37  static constexpr bool is_steady = true;
38  static const bool is_available;
39 
41  {
42  timespec t;
43  clock_gettime(CLOCK_MONOTONIC, &t);
44 
45  return time_point( std::chrono::seconds(t.tv_sec) + std::chrono::nanoseconds(t.tv_nsec) );
46  }
47 
48 };
49 
51 public:
54 
55 private:
56  void preallocate(edm::service::SystemBounds const & bounds);
57  void preStreamBeginRun(edm::StreamContext const & sc);
58  void postStreamEndLumi(edm::StreamContext const& sc);
59  void postStreamEndRun(edm::StreamContext const & sc);
60  void preSourceEvent(edm::StreamID sid);
61  void postEvent(edm::StreamContext const & sc);
62 
63 public:
64  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
65 
66 private:
67 
69  {
73  { }
74 
77  };
78 
79  std::vector<stream_histograms> m_stream_histograms;
80 
82 
83  // histogram-related data members
84  double m_time_range;
86 
87  // DQM service-related data members
88  unsigned int m_module_id; // pseudo module id for the FastTimerService, needed by the thread-safe DQMStore
90 };
91 
92 #endif // ! ThroughputService_h
void preallocate(edm::service::SystemBounds const &bounds)
string rep
Definition: cuy.py:1188
double seconds()
static constexpr bool is_steady
#define CLOCK_MONOTONIC
Definition: TimerService.h:33
clock_gettime_monotonic::time_point m_startup
void preSourceEvent(edm::StreamID sid)
static time_point now() noexcept
#define nullptr
void postStreamEndLumi(edm::StreamContext const &sc)
void postEvent(edm::StreamContext const &sc)
std::chrono::time_point< clock_gettime_monotonic, duration > time_point
std::string m_dqm_path
void preStreamBeginRun(edm::StreamContext const &sc)
std::vector< stream_histograms > m_stream_histograms
std::chrono::nanoseconds duration
#define noexcept
static const bool is_available
ThroughputService(const edm::ParameterSet &, edm::ActivityRegistry &)
void postStreamEndRun(edm::StreamContext const &sc)
unsigned int m_module_id
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
#define constexpr