File indexing completed on 2024-04-06 12:10:14
0001 #ifndef DQMServices_StreamerIO_DQMMonitoringService_h
0002 #define DQMServices_StreamerIO_DQMMonitoringService_h
0003
0004 #include <chrono>
0005
0006 #include <boost/asio.hpp>
0007 #include <boost/property_tree/ptree.hpp>
0008
0009
0010
0011
0012
0013
0014 namespace edm {
0015 class ActivityRegistry;
0016 class GlobalContext;
0017 class ParameterSet;
0018 class StreamID;
0019 }
0020
0021 namespace dqmservices {
0022
0023 class DQMMonitoringService {
0024 public:
0025 DQMMonitoringService(const edm::ParameterSet&, edm::ActivityRegistry&);
0026 ~DQMMonitoringService() = default;
0027
0028 void connect();
0029 void keepAlive();
0030
0031 void outputLumiUpdate();
0032 void outputUpdate(boost::property_tree::ptree& doc);
0033
0034 void evLumi(edm::GlobalContext const&);
0035 void evEvent(edm::StreamID const&);
0036
0037 void tryUpdate();
0038
0039 private:
0040 boost::asio::local::stream_protocol::iostream mstream_;
0041
0042
0043 long nevents_;
0044
0045
0046 std::chrono::high_resolution_clock::time_point last_lumi_time_;
0047 std::chrono::high_resolution_clock::time_point last_update_time_;
0048 long last_lumi_nevents_;
0049
0050 unsigned long last_lumi_;
0051
0052 unsigned long run_;
0053 unsigned long lumi_;
0054 };
0055
0056 }
0057
0058 #endif