3 #include <boost/algorithm/string.hpp>
4 #include <boost/format.hpp>
5 #include <boost/algorithm/string/predicate.hpp>
15 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;
44 using std::chrono::duration_cast;
45 using std::chrono::milliseconds;
53 doc.put(
"cmssw_run",
run_);
54 doc.put(
"cmssw_lumi",
lumi_);
62 if ((lumi_last > 0) && (lumi_millis > 0)) {
63 doc.put(
"lumi_number", lumi_last);
64 doc.put(
"lumi_events", lumi_events);
65 doc.put(
"lumi_duration_ms", lumi_millis);
67 float rate = ((float)lumi_events * 1000) / lumi_millis;
68 doc.put(
"events_rate", rate);
72 plumi.put(
"n", lumi_last);
73 plumi.put(
"nevents", lumi_events);
74 plumi.put(
"nmillis", lumi_millis);
75 plumi.put(
"rate", rate);
78 doc.add_child(str(
boost::format(
"extra.lumi_stats.%d") % hkey), plumi);
86 using std::chrono::duration_cast;
87 using std::chrono::milliseconds;
107 using std::chrono::duration_cast;
108 using std::chrono::milliseconds;
135 using std::chrono::duration_cast;
136 using std::chrono::milliseconds;
146 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)