1 #ifndef EVF_FASTMONITORINGTHREAD
2 #define EVF_FASTMONITORINGTHREAD
11 using namespace jsoncollector;
21 sShuttingDown, sDone, sJobEnded, sError, sErrorEnded, sEnd, sInvalid,MCOUNT};
51 fastMacrostateJ_ = FastMonitoringThread::sInit;
53 fastAvgLeadTimeJ_ = 0;
54 fastFilesProcessedJ_ = 0;
55 fastMacrostateJ_.setName(
"Macrostate");
56 fastThroughputJ_.setName(
"Throughput");
57 fastAvgLeadTimeJ_.setName(
"AverageLeadTime");
58 fastFilesProcessedJ_.setName(
"FilesProcessed");
60 fastPathProcessedJ_ = 0;
61 fastPathProcessedJ_.setName(
"Processed");
72 for (
unsigned int i=0;
i<nStreams;
i++) {
75 processed_.push_back(p);
76 streamLumi_.push_back(0);
79 microstateEncoded_.resize(nStreams);
80 ministateEncoded_.resize(nStreams);
81 threadMicrostateEncoded_.resize(nThreads);
86 if (nThreads<=nStreams)
107 jsonMonitor_.reset(
new FastMonitor(microStateDefPath,defGroup,
false));
108 if (fastMicroStateDefPath.size())
109 jsonMonitor_->addFastPathDefinition(fastMicroStateDefPath,defGroup,
false);
114 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_