1 #ifndef EVF_FASTMONITORINGTHREAD
2 #define EVF_FASTMONITORINGTHREAD
11 using namespace jsoncollector;
21 sShuttingDown, sDone, sJobEnded, sError, sErrorEnded, sEnd, sInvalid,MCOUNT};
53 fastMacrostateJ_ = FastMonitoringThread::sInit;
55 fastAvgLeadTimeJ_ = 0;
56 fastFilesProcessedJ_ = 0;
59 fastMacrostateJ_.setName(
"Macrostate");
60 fastThroughputJ_.setName(
"Throughput");
61 fastAvgLeadTimeJ_.setName(
"AverageLeadTime");
62 fastFilesProcessedJ_.setName(
"FilesProcessed");
63 fastLockWaitJ_.setName(
"LockWaitUs");
64 fastLockCountJ_.setName(
"LockCount");
66 fastPathProcessedJ_ = 0;
67 fastPathProcessedJ_.setName(
"Processed");
80 for (
unsigned int i=0;
i<nStreams;
i++) {
83 processed_.push_back(p);
84 streamLumi_.push_back(0);
87 microstateEncoded_.resize(nStreams);
88 ministateEncoded_.resize(nStreams);
89 threadMicrostateEncoded_.resize(nThreads);
94 if (nThreads<=nStreams)
115 jsonMonitor_.reset(
new FastMonitor(microStateDefPath,defGroup,
false));
116 if (fastMicroStateDefPath.size())
117 jsonMonitor_->addFastPathDefinition(fastMicroStateDefPath,defGroup,
false);
122 m_thread = boost::shared_ptr<std::thread>(
new std::thread(fp,cp));
void registerFastGlobalMonitorable(JsonMonitorable *newMonitorable)
std::vector< AtomicMonUInt * > processed_
void start(void(FastMonitoringService::*fp)(), FastMonitoringService *cp)
static boost::mutex mutex
unsigned int microstateBins_
void registerStreamMonitorableUIntVecAtomic(std::string const &name, std::vector< AtomicMonUInt * > *inputs, bool NAifZeroUpdates, unsigned int *nBins=nullptr)
unsigned int varIndexThrougput_
boost::shared_ptr< std::thread > m_thread
void registerGlobalMonitorable(JsonMonitorable *newMonitorable, bool NAifZeroUpdates, unsigned int *nBins=nullptr)
std::vector< unsigned int > threadMicrostateEncoded_
void registerStreamMonitorableUIntVec(std::string const &name, std::vector< unsigned int > *inputs, bool NAifZeroUpdates, unsigned int *nBins=nullptr)
void resetFastMonitor(std::string const µStateDefPath, std::string const &fastMicroStateDefPath)
void commit(std::vector< unsigned int > *streamLumisPtr)
tuple FastMonitoringService
DoubleJ fastAvgLeadTimeJ_
unsigned int AtomicMonUInt
std::vector< unsigned int > microstateEncoded_
void registerVariables(FastMonitor *fm, unsigned int nStreams, unsigned int nThreads)
IntJ fastFilesProcessedJ_
std::atomic< bool > m_stoprequest
std::unique_ptr< FastMonitor > jsonMonitor_
volatile std::atomic< bool > shutdown_flag false
unsigned int macrostateBins_
std::vector< unsigned int > streamLumi_
unsigned int ministateBins_
std::vector< unsigned int > ministateEncoded_