#include <RunMonitorCollection.h>
A collection of MonitoredQuantities related to events received in the current run
Definition at line 28 of file RunMonitorCollection.h.
typedef std::map<uint32_t, UnwantedEvent> stor::RunMonitorCollection::UnwantedEventsMap [private] |
Definition at line 117 of file RunMonitorCollection.h.
stor::RunMonitorCollection::RunMonitorCollection | ( | const utils::Duration_t & | updateInterval, |
SharedResourcesPtr | sr | ||
) |
Definition at line 20 of file RunMonitorCollection.cc.
: MonitorCollection(updateInterval), eventIDsReceived_(updateInterval, boost::posix_time::seconds(1)), errorEventIDsReceived_(updateInterval, boost::posix_time::seconds(1)), unwantedEventIDsReceived_(updateInterval, boost::posix_time::seconds(1)), runNumbersSeen_(updateInterval, boost::posix_time::seconds(1)), lumiSectionsSeen_(updateInterval, boost::posix_time::seconds(1)), eolsSeen_(updateInterval, boost::posix_time::seconds(1)), sharedResources_(sr) {}
stor::RunMonitorCollection::RunMonitorCollection | ( | RunMonitorCollection const & | ) | [private] |
void stor::RunMonitorCollection::addUnwantedEvent | ( | const I2OChain & | ioc | ) |
Definition at line 100 of file RunMonitorCollection.cc.
References stor::MonitoredQuantity::addSample(), alarmParams_, stor::AlarmParams::careAboutUnwantedEvents_, stor::I2OChain::complete(), stor::I2OChain::eventNumber(), stor::I2OChain::faulty(), stor::I2OChain::outputModuleId(), pos, unwantedEventIDsReceived_, unwantedEventMapLock_, and unwantedEventsMap_.
Referenced by stor::EventDistributor::addEventToRelevantQueues().
{ if ( ! alarmParams_.careAboutUnwantedEvents_ ) return; if ( ioc.faulty() || !ioc.complete() ) return; unwantedEventIDsReceived_.addSample(ioc.eventNumber()); uint32_t outputModuleId = ioc.outputModuleId(); boost::mutex::scoped_lock sl(unwantedEventMapLock_); UnwantedEventsMap::iterator pos = unwantedEventsMap_.lower_bound(outputModuleId); if(pos != unwantedEventsMap_.end() && !(unwantedEventsMap_.key_comp()(outputModuleId, pos->first))) { // key already exists ++(pos->second.count); } else { UnwantedEvent newEvent(ioc); unwantedEventsMap_.insert(pos, UnwantedEventsMap::value_type(outputModuleId, newEvent)); } }
void stor::RunMonitorCollection::alarmErrorEvents | ( | ) | [private] |
Definition at line 137 of file RunMonitorCollection.cc.
References alarmParams_, prof2calltree::count, stor::AlarmHandler::ERROR, errorEventIDsReceived_, stor::AlarmParams::errorEvents_, stor::MonitoredQuantity::Stats::getDuration(), stor::MonitoredQuantity::Stats::getSampleCount(), stor::MonitoredQuantity::getStats(), stor::AlarmParams::isProductionSystem_, lumiQueryAPI::msg, stor::MonitoredQuantity::RECENT, sharedResources_, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by checkForBadEvents().
{ if ( ! alarmParams_.isProductionSystem_ ) return; const std::string alarmName("ErrorEvents"); MonitoredQuantity::Stats stats; errorEventIDsReceived_.getStats(stats); long long count = stats.getSampleCount(MonitoredQuantity::RECENT); if ( count >= alarmParams_.errorEvents_ ) { std::ostringstream msg; msg << "Received " << count << " error events in the last " << stats.getDuration(MonitoredQuantity::RECENT).total_seconds() << "s."; XCEPT_DECLARE( stor::exception::ErrorEvents, xcept, msg.str() ); sharedResources_->alarmHandler_->raiseAlarm( alarmName, AlarmHandler::ERROR, xcept ); } else { sharedResources_->alarmHandler_->revokeAlarm( alarmName ); } }
void stor::RunMonitorCollection::alarmUnwantedEvents | ( | UnwantedEventsMap::value_type & | val | ) | [private] |
Definition at line 162 of file RunMonitorCollection.cc.
References alarmParams_, stor::AlarmHandler::ERROR, stor::AlarmParams::isProductionSystem_, lumiQueryAPI::msg, sharedResources_, and stor::AlarmParams::unwantedEvents_.
Referenced by checkForBadEvents().
{ if ( ! alarmParams_.isProductionSystem_ ) return; if ( (val.second.count - val.second.previousCount) > alarmParams_.unwantedEvents_ ) { std::ostringstream msg; msg << "Received " << val.second.count << " events" << " not tagged for any stream or consumer." << " Output module " << sharedResources_->initMsgCollection_->getOutputModuleName(val.first) << " (id " << val.first << ")" << " HLT trigger bits: "; // This code snipped taken from evm:EventSelector::acceptEvent int byteIndex = 0; int subIndex = 0; for (unsigned int pathIndex = 0; pathIndex < val.second.hltTriggerCount; ++pathIndex) { int state = val.second.bitList[byteIndex] >> (subIndex * 2); state &= 0x3; msg << state << " "; ++subIndex; if (subIndex == 4) { ++byteIndex; subIndex = 0; } } XCEPT_DECLARE( stor::exception::UnwantedEvents, xcept, msg.str() ); sharedResources_->alarmHandler_->raiseAlarm( val.second.alarmName, AlarmHandler::ERROR, xcept ); val.second.previousCount = val.second.count; } else if (val.second.count == val.second.previousCount) // no more unwanted events arrived { sharedResources_->alarmHandler_->revokeAlarm( val.second.alarmName ); } }
void stor::RunMonitorCollection::checkForBadEvents | ( | ) | [private] |
Definition at line 127 of file RunMonitorCollection.cc.
References alarmErrorEvents(), alarmUnwantedEvents(), unwantedEventMapLock_, and unwantedEventsMap_.
Referenced by do_calculateStatistics().
{ alarmErrorEvents(); boost::mutex::scoped_lock sl(unwantedEventMapLock_); std::for_each(unwantedEventsMap_.begin(), unwantedEventsMap_.end(), boost::bind(&RunMonitorCollection::alarmUnwantedEvents, this, _1)); }
void stor::RunMonitorCollection::configureAlarms | ( | AlarmParams const & | alarmParams | ) |
Definition at line 35 of file RunMonitorCollection.cc.
References alarmParams_.
Referenced by stor::Ready::do_entryActionWork().
{ alarmParams_ = alarmParams; }
void stor::RunMonitorCollection::do_appendInfoSpaceItems | ( | InfoSpaceItems & | infoSpaceItems | ) | [private, virtual] |
Reimplemented from stor::MonitorCollection.
Definition at line 67 of file RunMonitorCollection.cc.
References dataEvents_, errorEvents_, runNumber_, and unwantedEvents_.
{ infoSpaceItems.push_back(std::make_pair("runNumber", &runNumber_)); infoSpaceItems.push_back(std::make_pair("dataEvents", &dataEvents_)); infoSpaceItems.push_back(std::make_pair("errorEvents", &errorEvents_)); infoSpaceItems.push_back(std::make_pair("unwantedEvents", &unwantedEvents_)); }
void stor::RunMonitorCollection::do_calculateStatistics | ( | ) | [private, virtual] |
Implements stor::MonitorCollection.
Definition at line 41 of file RunMonitorCollection.cc.
References stor::MonitoredQuantity::calculateStatistics(), checkForBadEvents(), eolsSeen_, errorEventIDsReceived_, eventIDsReceived_, lumiSectionsSeen_, runNumbersSeen_, and unwantedEventIDsReceived_.
{ eventIDsReceived_.calculateStatistics(); errorEventIDsReceived_.calculateStatistics(); unwantedEventIDsReceived_.calculateStatistics(); runNumbersSeen_.calculateStatistics(); lumiSectionsSeen_.calculateStatistics(); eolsSeen_.calculateStatistics(); checkForBadEvents(); }
void stor::RunMonitorCollection::do_reset | ( | ) | [private, virtual] |
Implements stor::MonitorCollection.
Definition at line 54 of file RunMonitorCollection.cc.
References eolsSeen_, errorEventIDsReceived_, eventIDsReceived_, lumiSectionsSeen_, stor::MonitoredQuantity::reset(), runNumbersSeen_, unwantedEventIDsReceived_, and unwantedEventsMap_.
{ eventIDsReceived_.reset(); errorEventIDsReceived_.reset(); unwantedEventIDsReceived_.reset(); runNumbersSeen_.reset(); lumiSectionsSeen_.reset(); eolsSeen_.reset(); unwantedEventsMap_.clear(); }
void stor::RunMonitorCollection::do_updateInfoSpaceItems | ( | ) | [private, virtual] |
Reimplemented from stor::MonitorCollection.
Definition at line 76 of file RunMonitorCollection.cc.
References dataEvents_, errorEventIDsReceived_, errorEvents_, eventIDsReceived_, stor::MonitoredQuantity::Stats::getLastSampleValue(), stor::MonitoredQuantity::Stats::getSampleCount(), stor::MonitoredQuantity::getStats(), runNumber_, runNumbersSeen_, unwantedEventIDsReceived_, and unwantedEvents_.
{ MonitoredQuantity::Stats runNumberStats; runNumbersSeen_.getStats(runNumberStats); runNumber_ = static_cast<xdata::UnsignedInteger32>( static_cast<unsigned int>(runNumberStats.getLastSampleValue())); MonitoredQuantity::Stats eventIDsReceivedStats; eventIDsReceived_.getStats(eventIDsReceivedStats); dataEvents_ = static_cast<xdata::UnsignedInteger32>( static_cast<unsigned int>(eventIDsReceivedStats.getSampleCount())); MonitoredQuantity::Stats errorEventIDsReceivedStats; errorEventIDsReceived_.getStats(errorEventIDsReceivedStats); errorEvents_ = static_cast<xdata::UnsignedInteger32>( static_cast<unsigned int>(errorEventIDsReceivedStats.getSampleCount())); MonitoredQuantity::Stats unwantedEventStats; unwantedEventIDsReceived_.getStats(unwantedEventStats); unwantedEvents_ = static_cast<xdata::UnsignedInteger32>( static_cast<unsigned int>(unwantedEventStats.getSampleCount())); }
MonitoredQuantity& stor::RunMonitorCollection::getEoLSSeenMQ | ( | ) | [inline] |
const MonitoredQuantity& stor::RunMonitorCollection::getEoLSSeenMQ | ( | ) | const [inline] |
Definition at line 75 of file RunMonitorCollection.h.
References eolsSeen_.
Referenced by stor::SMWebPageHelper::addDOMforRunMonitor(), and stor::StorageManager::receiveEndOfLumiSectionMessage().
{ return eolsSeen_; }
const MonitoredQuantity& stor::RunMonitorCollection::getErrorEventIDsReceivedMQ | ( | ) | const [inline] |
Definition at line 47 of file RunMonitorCollection.h.
References errorEventIDsReceived_.
Referenced by stor::SMWebPageHelper::addDOMforRunMonitor(), and stor::EventDistributor::tagCompleteEventForQueues().
{ return errorEventIDsReceived_; }
MonitoredQuantity& stor::RunMonitorCollection::getErrorEventIDsReceivedMQ | ( | ) | [inline] |
Definition at line 50 of file RunMonitorCollection.h.
References errorEventIDsReceived_.
{ return errorEventIDsReceived_; }
const MonitoredQuantity& stor::RunMonitorCollection::getEventIDsReceivedMQ | ( | ) | const [inline] |
Definition at line 40 of file RunMonitorCollection.h.
References eventIDsReceived_.
Referenced by stor::SMWebPageHelper::addDOMforRunMonitor(), and stor::EventDistributor::tagCompleteEventForQueues().
{ return eventIDsReceived_; }
MonitoredQuantity& stor::RunMonitorCollection::getEventIDsReceivedMQ | ( | ) | [inline] |
Definition at line 43 of file RunMonitorCollection.h.
References eventIDsReceived_.
{ return eventIDsReceived_; }
MonitoredQuantity& stor::RunMonitorCollection::getLumiSectionsSeenMQ | ( | ) | [inline] |
Definition at line 71 of file RunMonitorCollection.h.
References lumiSectionsSeen_.
{ return lumiSectionsSeen_; }
const MonitoredQuantity& stor::RunMonitorCollection::getLumiSectionsSeenMQ | ( | ) | const [inline] |
Definition at line 68 of file RunMonitorCollection.h.
References lumiSectionsSeen_.
Referenced by stor::SMWebPageHelper::addDOMforRunMonitor(), and stor::EventDistributor::tagCompleteEventForQueues().
{ return lumiSectionsSeen_; }
const MonitoredQuantity& stor::RunMonitorCollection::getRunNumbersSeenMQ | ( | ) | const [inline] |
Definition at line 61 of file RunMonitorCollection.h.
References runNumbersSeen_.
Referenced by stor::SMWebPageHelper::addDOMforRunMonitor(), and stor::EventDistributor::tagCompleteEventForQueues().
{ return runNumbersSeen_; }
MonitoredQuantity& stor::RunMonitorCollection::getRunNumbersSeenMQ | ( | ) | [inline] |
Definition at line 64 of file RunMonitorCollection.h.
References runNumbersSeen_.
{ return runNumbersSeen_; }
MonitoredQuantity& stor::RunMonitorCollection::getUnwantedEventIDsReceivedMQ | ( | ) | [inline] |
Definition at line 57 of file RunMonitorCollection.h.
References unwantedEventIDsReceived_.
{ return unwantedEventIDsReceived_; }
const MonitoredQuantity& stor::RunMonitorCollection::getUnwantedEventIDsReceivedMQ | ( | ) | const [inline] |
Definition at line 54 of file RunMonitorCollection.h.
References unwantedEventIDsReceived_.
Referenced by stor::SMWebPageHelper::addDOMforRunMonitor().
{ return unwantedEventIDsReceived_; }
RunMonitorCollection& stor::RunMonitorCollection::operator= | ( | RunMonitorCollection const & | ) | [private] |
Definition at line 130 of file RunMonitorCollection.h.
Referenced by addUnwantedEvent(), alarmErrorEvents(), alarmUnwantedEvents(), and configureAlarms().
xdata::UnsignedInteger32 stor::RunMonitorCollection::dataEvents_ [private] |
Definition at line 126 of file RunMonitorCollection.h.
Referenced by do_appendInfoSpaceItems(), and do_updateInfoSpaceItems().
Definition at line 96 of file RunMonitorCollection.h.
Referenced by do_calculateStatistics(), do_reset(), and getEoLSSeenMQ().
Definition at line 92 of file RunMonitorCollection.h.
Referenced by alarmErrorEvents(), do_calculateStatistics(), do_reset(), do_updateInfoSpaceItems(), and getErrorEventIDsReceivedMQ().
xdata::UnsignedInteger32 stor::RunMonitorCollection::errorEvents_ [private] |
Definition at line 127 of file RunMonitorCollection.h.
Referenced by do_appendInfoSpaceItems(), and do_updateInfoSpaceItems().
Definition at line 91 of file RunMonitorCollection.h.
Referenced by do_calculateStatistics(), do_reset(), do_updateInfoSpaceItems(), and getEventIDsReceivedMQ().
Definition at line 95 of file RunMonitorCollection.h.
Referenced by do_calculateStatistics(), do_reset(), and getLumiSectionsSeenMQ().
xdata::UnsignedInteger32 stor::RunMonitorCollection::runNumber_ [private] |
Definition at line 125 of file RunMonitorCollection.h.
Referenced by do_appendInfoSpaceItems(), and do_updateInfoSpaceItems().
Definition at line 94 of file RunMonitorCollection.h.
Referenced by do_calculateStatistics(), do_reset(), do_updateInfoSpaceItems(), and getRunNumbersSeenMQ().
Definition at line 98 of file RunMonitorCollection.h.
Referenced by alarmErrorEvents(), and alarmUnwantedEvents().
Definition at line 93 of file RunMonitorCollection.h.
Referenced by addUnwantedEvent(), do_calculateStatistics(), do_reset(), do_updateInfoSpaceItems(), and getUnwantedEventIDsReceivedMQ().
boost::mutex stor::RunMonitorCollection::unwantedEventMapLock_ [mutable, private] |
Definition at line 119 of file RunMonitorCollection.h.
Referenced by addUnwantedEvent(), and checkForBadEvents().
xdata::UnsignedInteger32 stor::RunMonitorCollection::unwantedEvents_ [private] |
Definition at line 128 of file RunMonitorCollection.h.
Referenced by do_appendInfoSpaceItems(), and do_updateInfoSpaceItems().
Definition at line 118 of file RunMonitorCollection.h.
Referenced by addUnwantedEvent(), checkForBadEvents(), and do_reset().