3 #include <boost/algorithm/string.hpp>
4 #include <boost/format.hpp>
5 #include <boost/algorithm/string/predicate.hpp>
14 namespace dqmservices {
18 const char*
x = getenv(
"DQM2_SOCKET");
20 std::cerr <<
"Monitoring pipe: " << x << std::endl;
21 mstream_.connect(boost::asio::local::stream_protocol::endpoint(x));
23 std::cerr <<
"Monitoring file not found, disabling." << std::endl;
43 using std::chrono::duration_cast;
44 using std::chrono::milliseconds;
52 doc.put(
"cmssw_run",
run_);
53 doc.put(
"cmssw_lumi",
lumi_);
61 if ((lumi_last > 0) && (lumi_millis > 0)) {
62 doc.put(
"lumi_number", lumi_last);
63 doc.put(
"lumi_events", lumi_events);
64 doc.put(
"lumi_duration_ms", lumi_millis);
66 float rate = ((float)lumi_events * 1000) / lumi_millis;
67 doc.put(
"events_rate", rate);
71 plumi.put(
"n", lumi_last);
72 plumi.put(
"nevents", lumi_events);
73 plumi.put(
"nmillis", lumi_millis);
74 plumi.put(
"rate", rate);
76 std::time_t hkey = std::time(
NULL);
77 doc.add_child(str(
boost::format(
"extra.lumi_stats.%d") % hkey), plumi);
84 using std::chrono::duration_cast;
85 using std::chrono::milliseconds;
105 using std::chrono::duration_cast;
106 using std::chrono::milliseconds;
112 doc.put(
"update_timestamp", std::time(
NULL));
131 using std::chrono::duration_cast;
132 using std::chrono::milliseconds;
141 if (millis >= (25 * 1000)) {
LuminosityBlockID const & luminosityBlockID() const
void watchPreGlobalBeginLumi(PreGlobalBeginLumi::slot_type const &iSlot)
string format
Some error handling for the usage.
T x() const
Cartesian x coordinate.
void evEvent(StreamID const &)
boost::asio::local::stream_protocol::iostream mstream_
tuple DQMMonitoringService
#define DEFINE_FWK_SERVICE(type)
LuminosityBlockNumber_t luminosityBlock() const
std::chrono::high_resolution_clock::time_point last_lumi_time_
DQMMonitoringService(const edm::ParameterSet &, edm::ActivityRegistry &)
void watchPreSourceEvent(PreSourceEvent::slot_type const &iSlot)
std::chrono::high_resolution_clock::time_point last_update_time_
void evLumi(GlobalContext const &)
void outputUpdate(ptree &doc)