Commit ca4f5a12 authored by Andrea Petrucci's avatar Andrea Petrucci
Browse files

references #295: first version of disable monitoring information when a BU is not used

parent 7f1f6ccd
......@@ -106,6 +106,7 @@ namespace evb {
*/
uint32_t getNbLumiSections() const;
void resetMonitoringCounters();
private:
......@@ -135,7 +136,6 @@ namespace evb {
bool getReadyFileInfo(FileInfoPtr&);
bool populateFileInfo(FileInfoPtr&);
void resetMonitoringCounters();
void startFileAccounting();
bool idle() const;
bool fileAccounting(toolbox::task::WorkLoop*);
......
......@@ -122,6 +122,7 @@ namespace evb {
*/
uint64_t getNbEventsMissingData() const;
void resetMonitoringCounters();
private:
......
......@@ -118,10 +118,10 @@ namespace evb {
*/
void lumisectionInfoCallback(toolbox::mem::Reference*);
void resetMonitoringCounters();
private:
void resetMonitoringCounters();
void getApplicationDescriptors();
void startEventFragmentWorkLoop();
void startRequestFragmentsWorkLoop();
......
......@@ -194,13 +194,14 @@ namespace evb {
void setBlacklistedFUcount(const uint16_t count)
{ blacklistedFUcount_ = count; }
void resetMonitoringCounters();
private:
using EvBidList = std::list<EvBid>;
using LumiSectionAccounts = std::map<uint32_t,LumiSectionAccountPtr>;
void resetMonitoringCounters();
void incrementEventsInLumiSection(const EvBidList&);
void eventCompletedForLumiSection(const uint32_t lumiSection);
LumiSectionAccounts::const_iterator getLumiSectionAccount(const uint32_t lumiSection);
......
......@@ -147,6 +147,8 @@ namespace evb {
virtual ~Halted()
{ safeExitAction(); }
virtual void entryAction();
void activity();
};
......
......@@ -5,8 +5,8 @@
#define WORKSUITE_EVB_VERSION_MAJOR 6
#define WORKSUITE_EVB_VERSION_MINOR 9
#define WORKSUITE_EVB_VERSION_PATCH 7
#define WORKSUITE_EVB_PREVIOUS_VERSIONS "6.5.0,6.5.1,6.5.2,6.6.0,6.6.1,6.7.0,6.7.1,6.8.0,6.8.1,6.8.2,6.9.0,6.9.1,6.9.2,6.9.3,6.9.4,6.9.5,6.9.6"
#define WORKSUITE_EVB_VERSION_PATCH 8
#define WORKSUITE_EVB_PREVIOUS_VERSIONS "6.5.0,6.5.1,6.5.2,6.6.0,6.6.1,6.7.0,6.7.1,6.8.0,6.8.1,6.8.2,6.9.0,6.9.1,6.9.2,6.9.3,6.9.4,6.9.5,6.9.6,6.9.7"
#define WORKSUITE_EVB_VERSION_CODE PACKAGE_VERSION_CODE(WORKSUITE_EVB_VERSION_MAJOR,WORKSUITE_EVB_VERSION_MINOR,WORKSUITE_EVB_VERSION_PATCH)
#ifndef WORKSUITE_EVB_PREVIOUS_VERSIONS
......
......@@ -114,6 +114,21 @@ void evb::bu::EventBuilder::createProcessingWorkLoops()
}
}
void evb::bu::EventBuilder::resetMonitoringCounters()
{
for (auto& monitor : eventMapMonitors_)
{
monitor.second.reset();
}
{
std::lock_guard<std::mutex> guard(errorCountMutex_);
corruptedEvents_ = 0;
eventsWithCRCerrors_ = 0;
eventsMissingData_ = 0;
}
}
void evb::bu::EventBuilder::startProcessing(const uint32_t runNumber)
{
......
......@@ -25,6 +25,51 @@ evb::bu::StateMachine::StateMachine
resourceManager_(resourceManager)
{}
void evb::bu::Halted::entryAction()
{
auto thread = std::thread(&evb::bu::Halted::activity, this);
thread.detach(); // otherwise, the thread tries to destruct itself on exiting this state
}
void evb::bu::Halted::activity()
{
outermost_context_type& stateMachine = outermost_context();
std::string msg = "Failed to reset counter";
try
{
outermost_context_type& stateMachine = outermost_context();
if ( stateMachine.bu()->getConfiguration()->useLock )
stateMachine.acquireLock();
stateMachine.resourceManager()->resetMonitoringCounters();
stateMachine.ruProxy()->resetMonitoringCounters();
stateMachine.eventBuilder()->resetMonitoringCounters();
stateMachine.diskWriter()->resetMonitoringCounters();
}
catch(xcept::Exception& e)
{
XCEPT_DECLARE_NESTED(exception::FSM,
sentinelException, msg, e);
stateMachine.processFSMEvent( Fail(sentinelException) );
}
catch(std::exception& e)
{
msg += ": ";
msg += e.what();
XCEPT_DECLARE(exception::FSM,
sentinelException, msg );
stateMachine.processFSMEvent( Fail(sentinelException) );
}
catch(...)
{
msg += ": unknown exception";
XCEPT_DECLARE(exception::FSM,
sentinelException, msg );
stateMachine.processFSMEvent( Fail(sentinelException) );
}
}
void evb::bu::Configuring::entryAction()
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment