test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQMMonitoringService.h
Go to the documentation of this file.
1 #ifndef DQMServices_StreamerIO_DQMMonitoringService_h
2 #define DQMServices_StreamerIO_DQMMonitoringService_h
3 
15 #include "boost/filesystem.hpp"
16 
17 #include <string>
18 #include <vector>
19 #include <map>
20 #include <queue>
21 #include <sstream>
22 #include <chrono>
23 #include <unordered_map>
24 
25 #include <boost/filesystem.hpp>
26 #include <boost/format.hpp>
27 #include <boost/property_tree/json_parser.hpp>
28 #include <boost/property_tree/ptree.hpp>
29 #include <boost/asio.hpp>
30 
31 /*
32  * This service is very similar to the FastMonitoringService in the HLT,
33  * except that it is used for monitoring online DQM applications
34  */
35 
36 namespace dqmservices {
37 
38 using boost::property_tree::ptree;
39 
40 using edm::StreamID;
41 using edm::StreamContext;
42 using edm::GlobalContext;
43 
45  public:
48 
49  void connect();
50  void keepAlive();
51 
52  void outputLumiUpdate();
53  void outputUpdate(ptree& doc);
54 
55  void evLumi(GlobalContext const&);
56  void evEvent(StreamID const&);
57 
58  void tryUpdate();
59 
60  private:
61  boost::asio::local::stream_protocol::iostream mstream_;
62 
63  // global number of events processed
64  long nevents_;
65 
66  // time point, number of events and the lumi number at the time we switched to
67  // it
68  unsigned long last_lumi_; // last lumi (we report stats for it, after we
69  // switch to the next one)
70  std::chrono::high_resolution_clock::time_point last_lumi_time_;
71  std::chrono::high_resolution_clock::time_point last_update_time_;
73 
74  unsigned long run_; // current run
75  unsigned long lumi_; // current lumi
76 };
77 
78 } // end-of-namespace
79 
80 #endif
boost::asio::local::stream_protocol::iostream mstream_
std::chrono::high_resolution_clock::time_point last_lumi_time_
DQMMonitoringService(const edm::ParameterSet &, edm::ActivityRegistry &)
std::chrono::high_resolution_clock::time_point last_update_time_
void evLumi(GlobalContext const &)