CMS 3D CMS Logo

ThroughputService.h
Go to the documentation of this file.
1 #ifndef ThroughputService_h
2 #define ThroughputService_h
3 
4 // C++ headers
5 #include <atomic>
6 #include <chrono>
7 #include <functional>
8 #include <string>
9 
10 // TBB headers
11 #include <oneapi/tbb/concurrent_vector.h>
12 
13 // ROOT headers
14 #include <TH1F.h>
15 
16 // CMSSW headers
29 
31 public:
33 
35  ~ThroughputService() = default;
36 
37 private:
39  void preGlobalBeginRun(edm::GlobalContext const& gc);
40  void preSourceEvent(edm::StreamID sid);
41  void postEvent(edm::StreamContext const& sc);
42  void postEndJob();
43 
44 public:
45  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
46 
47 private:
50 
51  std::chrono::system_clock::time_point m_startup;
52 
53  // event time buffer
54  const uint32_t m_resolution;
55  std::atomic<uint32_t> m_counter;
56  tbb::concurrent_vector<std::chrono::system_clock::time_point> m_events;
58 
59  // DQM related data members
61  const bool m_dqm_bynproc;
63  const double m_time_range;
64  const double m_time_resolution;
65 };
66 
67 #endif // ! ThroughputService_h
void preallocate(edm::service::SystemBounds const &bounds)
dqm::reco::MonitorElement * m_sourced_events
void preSourceEvent(edm::StreamID sid)
dqm::reco::MonitorElement * m_retired_events
void postEvent(edm::StreamContext const &sc)
tbb::concurrent_vector< std::chrono::system_clock::time_point > m_events
void preGlobalBeginRun(edm::GlobalContext const &gc)
dqm::reco::DQMStore DQMStore
std::string m_dqm_path
~ThroughputService()=default
ThroughputService(const edm::ParameterSet &, edm::ActivityRegistry &)
std::atomic< uint32_t > m_counter
std::chrono::system_clock::time_point m_startup
const double m_time_resolution
const double m_time_range
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const bool m_dqm_bynproc
const uint32_t m_resolution