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  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

Constructor & Destructor Documentation

evf::FastMonitoringThread::FastMonitoringThread ( )
inline

Definition at line 109 of file FastMonitoringThread.h.

109  : m_stoprequest(false) {
110  }
std::atomic< bool > m_stoprequest

Member Function Documentation

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

Definition at line 112 of file FastMonitoringThread.h.

References jsonMonitor_, and AlCaHLTBitMon_QueryRunRegistry::string.

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

112  {
113  std::string defGroup = "data";
114  jsonMonitor_.reset(new jsoncollector::FastMonitor(microStateDefPath,defGroup,false));
115  if (fastMicroStateDefPath.size())
116  jsonMonitor_->addFastPathDefinition(fastMicroStateDefPath,defGroup,false);
117  }
std::unique_ptr< jsoncollector::FastMonitor > jsonMonitor_
void evf::FastMonitoringThread::start ( void(FastMonitoringService::*)()  fp,
FastMonitoringService cp 
)
inline

Definition at line 119 of file FastMonitoringThread.h.

References assert(), and m_thread.

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

119  {
120  assert(!m_thread);
121  m_thread = boost::shared_ptr<std::thread>(new std::thread(fp,cp));
122  }
assert(m_qm.get())
boost::shared_ptr< std::thread > m_thread
void evf::FastMonitoringThread::stop ( )
inline

Definition at line 123 of file FastMonitoringThread.h.

References assert(), m_stoprequest, and m_thread.

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

123  {
124  assert(m_thread);
125  m_stoprequest=true;
126  m_thread->join();
127  }
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 138 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 131 of file FastMonitoringThread.h.

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

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

Definition at line 132 of file FastMonitoringThread.h.

Referenced by start(), and stop().

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