1 #ifndef EVF_FASTMONITORINGTHREAD 2 #define EVF_FASTMONITORINGTHREAD 14 class FastMonitoringService;
22 enum InputState {
inIgnore = 0,
inInit,
inWaitInput,
inNewLumi,
inNewLumiBusyEndingLS,
inNewLumiIdleEndingLS,
inRunEnd,
inProcessingFile,
inWaitChunk ,
inChunkReceived,
77 fastAvgLeadTimeJ_ = 0;
78 fastFilesProcessedJ_ = 0;
81 fastMacrostateJ_.
setName(
"Macrostate");
82 fastThroughputJ_.
setName(
"Throughput");
83 fastAvgLeadTimeJ_.
setName(
"AverageLeadTime");
84 fastFilesProcessedJ_.
setName(
"FilesProcessed");
85 fastLockWaitJ_.
setName(
"LockWaitUs");
86 fastLockCountJ_.
setName(
"LockCount");
88 fastPathProcessedJ_ = 0;
89 fastPathProcessedJ_.
setName(
"Processed");
102 for (
unsigned int i=0;
i<nStreams;
i++) {
105 processed_.push_back(p);
106 streamLumi_.push_back(0);
109 microstateEncoded_.resize(nStreams);
110 ministateEncoded_.resize(nStreams);
111 threadMicrostateEncoded_.resize(nThreads);
112 inputState_.resize(nStreams);
113 for (
unsigned int j=0;j<inputState_.size();j++) inputState_[j]=0;
118 if (nThreads<=nStreams)
143 if (fastMicroStateDefPath.size())
144 jsonMonitor_->addFastPathDefinition(fastMicroStateDefPath,defGroup,
false);
149 m_thread = std::shared_ptr<std::thread>(
new std::thread(fp,cp));
void registerFastGlobalMonitorable(JsonMonitorable *newMonitorable)
jsoncollector::IntJ fastEventsProcessedJ_
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)
jsoncollector::DoubleJ fastThroughputJ_
unsigned int varIndexThrougput_
std::shared_ptr< std::thread > m_thread
unsigned int inputstateBins_
void registerGlobalMonitorable(JsonMonitorable *newMonitorable, bool NAifZeroUpdates, unsigned int *nBins=nullptr)
jsoncollector::IntJ fastMacrostateJ_
void registerVariables(jsoncollector::FastMonitor *fm, unsigned int nStreams, unsigned int nThreads)
std::vector< unsigned int > threadMicrostateEncoded_
virtual void setName(std::string name)
void registerStreamMonitorableUIntVec(std::string const &name, std::vector< unsigned int > *inputs, bool NAifZeroUpdates, unsigned int *nBins=nullptr)
std::unique_ptr< jsoncollector::FastMonitor > jsonMonitor_
jsoncollector::IntJ fastFilesProcessedJ_
jsoncollector::DoubleJ fastAvgLeadTimeJ_
void resetFastMonitor(std::string const µStateDefPath, std::string const &fastMicroStateDefPath)
jsoncollector::DoubleJ fastLockWaitJ_
void commit(std::vector< unsigned int > *streamLumisPtr)
unsigned int AtomicMonUInt
std::vector< unsigned int > microstateEncoded_
jsoncollector::IntJ fastPathProcessedJ_
jsoncollector::IntJ fastLockCountJ_
std::atomic< bool > m_stoprequest
std::vector< jsoncollector::AtomicMonUInt * > processed_
unsigned int macrostateBins_
std::vector< unsigned int > streamLumi_
unsigned int ministateBins_
std::vector< unsigned int > inputState_
std::vector< unsigned int > ministateEncoded_