4 #include "toolbox/task/WorkLoopFactory.h"
5 #include "xcept/tools.h"
12 #include "EventFilter/StorageManager/src/DQMEventStore.icc"
26 tempEventArea_.clear();
36 actionIsActive_(
true),
37 latestLumiSection_(0),
38 discardDQMUpdatesForOlderLS_(0),
41 app->getApplicationDescriptor(),
42 sr->dqmEventQueueCollection_,
43 sr->statisticsReporter_->getDQMEventMonitorCollection(),
44 &sr->statisticsReporter_->getDataSenderMonitorCollection(),
46 sr->alarmHandler_.
get(),
73 processWL_ = toolbox::task::getWorkLoopFactory()->
74 getWorkLoop( identifier + workloopName,
"waiting" );
76 if ( ! processWL_->isActive() )
78 toolbox::task::ActionSignature* processAction =
80 identifier +
"ProcessNextDQMEvent");
81 processWL_->submit(processAction);
83 processWL_->activate();
88 std::string
msg =
"Failed to start workloop 'DQMEventProcessor' with 'processNextDQMEvent'.";
89 XCEPT_RETHROW(stor::exception::DQMEventProcessing, msg, e);
96 std::string errorMsg =
"Failed to process a DQM event: ";
104 XCEPT_DECLARE_NESTED( stor::exception::DQMEventProcessing,
105 sentinelException, errorMsg, e );
110 errorMsg += e.what();
111 XCEPT_DECLARE( stor::exception::DQMEventProcessing,
112 sentinelException, errorMsg );
117 errorMsg +=
"Unknown exception";
118 XCEPT_DECLARE( stor::exception::DQMEventProcessing,
119 sentinelException, errorMsg );
132 if (eq->deqTimedWait(dqmEvent,
timeout_))
136 addDQMEventProcessorIdleSample(elapsedTime);
146 getDroppedDQMEventCountsMQ().addSample(dqmEvent.second + 1);
151 addPoppedDQMEventSample(dqmEvent.first.memoryUsed());
153 getDroppedDQMEventCountsMQ().addSample(dqmEvent.second);
163 addDQMEventProcessorIdleSample(elapsedTime);
168 boost::posix_time::time_duration newTimeoutValue;
170 getRequests(requests, dqmParams, newTimeoutValue))
TimePoint_t getCurrentTime()
DQMEventMsgView getDQMEventView(EventType const &)
unsigned int discardDQMUpdatesForOlderLS_
toolbox::task::WorkLoop * processWL_
boost::shared_ptr< SharedResources > SharedResourcesPtr
void processNextDQMEvent()
boost::shared_ptr< DQMEventQueue > DQMEventQueuePtr
SharedResourcesPtr sharedResources_
uint32_t latestLumiSection_
EnqPolicy::ValueType ValueType
boost::posix_time::time_duration Duration_t
const T & max(const T &a, const T &b)
boost::posix_time::time_duration DQMEPdeqWaitTime_
bool processDQMEvents(toolbox::task::WorkLoop *)
void startWorkLoop(std::string workloopName)
boost::posix_time::ptime TimePoint_t
DQMEventStore< I2OChain, DataSenderMonitorCollection, AlarmHandler > dqmEventStore_
unsigned int copyFragmentsIntoBuffer(std::vector< unsigned char > &buff) const
std::string getIdentifier(xdaq::ApplicationDescriptor *)
unsigned int discardDQMUpdatesForOlderLS_
T get(const Candidate &c)
boost::posix_time::time_duration timeout_
DQMEventProcessor(xdaq::Application *, SharedResourcesPtr sr)