test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Attributes | Friends
evf::FastMonitoringThread Class Reference

#include <FastMonitoringThread.h>

Classes

struct  MonitorData
 

Public Types

enum  InputState {
  inIgnore = 0, inInit, inWaitInput, inNewLumi,
  inNewLumiBusyEndingLS, inNewLumiIdleEndingLS, inRunEnd, inProcessingFile,
  inWaitChunk, inChunkReceived, inChecksumEvent, inCachedEvent,
  inReadEvent, inReadCleanup, inNoRequest, inNoRequestWithIdleThreads,
  inNoRequestWithGlobalEoL, inNoRequestWithEoLThreads, inSupFileLimit, inSupWaitFreeChunk,
  inSupWaitFreeChunkCopying, inSupWaitFreeThread, inSupWaitFreeThreadCopying, inSupBusy,
  inSupLockPolling, inSupLockPollingCopying, inSupNoFile, inSupNewFile,
  inSupNewFileWaitThreadCopying, inSupNewFileWaitThread, inSupNewFileWaitChunkCopying, inSupNewFileWaitChunk,
  inWaitInput_fileLimit, inWaitInput_waitFreeChunk, inWaitInput_waitFreeChunkCopying, inWaitInput_waitFreeThread,
  inWaitInput_waitFreeThreadCopying, inWaitInput_busy, inWaitInput_lockPolling, inWaitInput_lockPollingCopying,
  inWaitInput_runEnd, inWaitInput_noFile, inWaitInput_newFile, inWaitInput_newFileWaitThreadCopying,
  inWaitInput_newFileWaitThread, inWaitInput_newFileWaitChunkCopying, inWaitInput_newFileWaitChunk, inWaitChunk_fileLimit,
  inWaitChunk_waitFreeChunk, inWaitChunk_waitFreeChunkCopying, inWaitChunk_waitFreeThread, inWaitChunk_waitFreeThreadCopying,
  inWaitChunk_busy, inWaitChunk_lockPolling, inWaitChunk_lockPollingCopying, inWaitChunk_runEnd,
  inWaitChunk_noFile, inWaitChunk_newFile, inWaitChunk_newFileWaitThreadCopying, inWaitChunk_newFileWaitThread,
  inWaitChunk_newFileWaitChunkCopying, inWaitChunk_newFileWaitChunk, inCOUNT
}
 
enum  Macrostate {
  sInit = 0, sJobReady, sRunGiven, sRunning,
  sStopping, sShuttingDown, sDone, sJobEnded,
  sError, sErrorEnded, sEnd, sInvalid,
  MCOUNT
}
 

Public Member Functions

 FastMonitoringThread ()
 
void resetFastMonitor (std::string const &microStateDefPath, std::string const &fastMicroStateDefPath)
 
void start (void(FastMonitoringService::*fp)(), FastMonitoringService *cp)
 
void stop ()
 

Private Attributes

std::unique_ptr
< jsoncollector::FastMonitor
jsonMonitor_
 
MonitorData m_data
 
std::atomic< bool > m_stoprequest
 
boost::shared_ptr< std::thread > m_thread
 
std::mutex monlock_
 

Friends

class FastMonitoringService
 

Detailed Description

Definition at line 16 of file FastMonitoringThread.h.

Member Enumeration Documentation

Enumerator
inIgnore 
inInit 
inWaitInput 
inNewLumi 
inNewLumiBusyEndingLS 
inNewLumiIdleEndingLS 
inRunEnd 
inProcessingFile 
inWaitChunk 
inChunkReceived 
inChecksumEvent 
inCachedEvent 
inReadEvent 
inReadCleanup 
inNoRequest 
inNoRequestWithIdleThreads 
inNoRequestWithGlobalEoL 
inNoRequestWithEoLThreads 
inSupFileLimit 
inSupWaitFreeChunk 
inSupWaitFreeChunkCopying 
inSupWaitFreeThread 
inSupWaitFreeThreadCopying 
inSupBusy 
inSupLockPolling 
inSupLockPollingCopying 
inSupNoFile 
inSupNewFile 
inSupNewFileWaitThreadCopying 
inSupNewFileWaitThread 
inSupNewFileWaitChunkCopying 
inSupNewFileWaitChunk 
inWaitInput_fileLimit 
inWaitInput_waitFreeChunk 
inWaitInput_waitFreeChunkCopying 
inWaitInput_waitFreeThread 
inWaitInput_waitFreeThreadCopying 
inWaitInput_busy 
inWaitInput_lockPolling 
inWaitInput_lockPollingCopying 
inWaitInput_runEnd 
inWaitInput_noFile 
inWaitInput_newFile 
inWaitInput_newFileWaitThreadCopying 
inWaitInput_newFileWaitThread 
inWaitInput_newFileWaitChunkCopying 
inWaitInput_newFileWaitChunk 
inWaitChunk_fileLimit 
inWaitChunk_waitFreeChunk 
inWaitChunk_waitFreeChunkCopying 
inWaitChunk_waitFreeThread 
inWaitChunk_waitFreeThreadCopying 
inWaitChunk_busy 
inWaitChunk_lockPolling 
inWaitChunk_lockPollingCopying 
inWaitChunk_runEnd 
inWaitChunk_noFile 
inWaitChunk_newFile 
inWaitChunk_newFileWaitThreadCopying 
inWaitChunk_newFileWaitThread 
inWaitChunk_newFileWaitChunkCopying 
inWaitChunk_newFileWaitChunk 
inCOUNT 

Definition at line 22 of file FastMonitoringThread.h.

25  //supervisor thread and worker threads state
29  //combined with inWaitInput
34  //combined with inWaitChunk
39  inCOUNT};

Constructor & Destructor Documentation

evf::FastMonitoringThread::FastMonitoringThread ( )
inline

Definition at line 137 of file FastMonitoringThread.h.

137  : m_stoprequest(false) {
138  }
std::atomic< bool > m_stoprequest

Member Function Documentation

void evf::FastMonitoringThread::resetFastMonitor ( std::string const &  microStateDefPath,
std::string const &  fastMicroStateDefPath 
)
inline

Definition at line 140 of file FastMonitoringThread.h.

References jsonMonitor_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by evf::FastMonitoringService::preBeginJob().

140  {
141  std::string defGroup = "data";
142  jsonMonitor_.reset(new jsoncollector::FastMonitor(microStateDefPath,defGroup,false));
143  if (fastMicroStateDefPath.size())
144  jsonMonitor_->addFastPathDefinition(fastMicroStateDefPath,defGroup,false);
145  }
std::unique_ptr< jsoncollector::FastMonitor > jsonMonitor_
void evf::FastMonitoringThread::start ( void(FastMonitoringService::*)()  fp,
FastMonitoringService cp 
)
inline

Definition at line 147 of file FastMonitoringThread.h.

References assert(), and m_thread.

Referenced by progressbar.ProgressBar::__next__(), Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), and evf::FastMonitoringService::preBeginJob().

147  {
148  assert(!m_thread);
149  m_thread = boost::shared_ptr<std::thread>(new std::thread(fp,cp));
150  }
assert(m_qm.get())
boost::shared_ptr< std::thread > m_thread
void evf::FastMonitoringThread::stop ( )
inline

Definition at line 151 of file FastMonitoringThread.h.

References assert(), m_stoprequest, and m_thread.

Referenced by evf::FastMonitoringService::postEndJob().

151  {
152  assert(m_thread);
153  m_stoprequest=true;
154  m_thread->join();
155  }
assert(m_qm.get())
boost::shared_ptr< std::thread > m_thread
std::atomic< bool > m_stoprequest

Friends And Related Function Documentation

friend class FastMonitoringService
friend

Definition at line 166 of file FastMonitoringThread.h.

Member Data Documentation

std::unique_ptr<jsoncollector::FastMonitor> evf::FastMonitoringThread::jsonMonitor_
private
MonitorData evf::FastMonitoringThread::m_data
private
std::atomic<bool> evf::FastMonitoringThread::m_stoprequest
private

Definition at line 159 of file FastMonitoringThread.h.

Referenced by evf::FastMonitoringService::dowork(), and stop().

boost::shared_ptr<std::thread> evf::FastMonitoringThread::m_thread
private

Definition at line 160 of file FastMonitoringThread.h.

Referenced by start(), and stop().

std::mutex evf::FastMonitoringThread::monlock_
private