CMS 3D CMS Logo

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

#include <FastMonitoringThread.h>

Classes

struct  MonitorData
 

Public Member Functions

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

Private Attributes

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

Friends

class FastMonitoringService
 

Detailed Description

Definition at line 119 of file FastMonitoringThread.h.

Constructor & Destructor Documentation

evf::FastMonitoringThread::FastMonitoringThread ( )
inline

Definition at line 228 of file FastMonitoringThread.h.

228 : m_stoprequest(false) {}
std::atomic< bool > m_stoprequest
evf::FastMonitoringThread::~FastMonitoringThread ( )
inline

Definition at line 249 of file FastMonitoringThread.h.

References stop().

Member Function Documentation

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

Definition at line 230 of file FastMonitoringThread.h.

References jsonMonitor_, and AlCaHLTBitMon_QueryRunRegistry::string.

230  {
231  std::string defGroup = "data";
232  jsonMonitor_ = std::make_unique<jsoncollector::FastMonitor>(microStateDefPath, defGroup, false);
233  if (!fastMicroStateDefPath.empty())
234  jsonMonitor_->addFastPathDefinition(fastMicroStateDefPath, defGroup, false);
235  }
std::unique_ptr< jsoncollector::FastMonitor > jsonMonitor_
void evf::FastMonitoringThread::start ( void(FastMonitoringService::*)()  fp,
FastMonitoringService cp 
)
inline

Definition at line 237 of file FastMonitoringThread.h.

References cms::cuda::assert(), CommonMethods::cp(), personalPlayback::fp, and m_thread.

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

237  {
238  assert(!m_thread);
239  m_thread = std::make_shared<std::thread>(fp, cp);
240  }
std::shared_ptr< std::thread > m_thread
assert(be >=bs)
void evf::FastMonitoringThread::stop ( )
inline

Definition at line 241 of file FastMonitoringThread.h.

References m_stoprequest, and m_thread.

Referenced by ~FastMonitoringThread().

241  {
242  if (m_thread.get()) {
243  m_stoprequest = true;
244  m_thread->join();
245  m_thread.reset();
246  }
247  }
std::shared_ptr< std::thread > m_thread
std::atomic< bool > m_stoprequest

Friends And Related Function Documentation

friend class FastMonitoringService
friend

Definition at line 259 of file FastMonitoringThread.h.

Member Data Documentation

std::unique_ptr<jsoncollector::FastMonitor> evf::FastMonitoringThread::jsonMonitor_
private

Definition at line 257 of file FastMonitoringThread.h.

Referenced by resetFastMonitor().

MonitorData evf::FastMonitoringThread::m_data
private

Definition at line 254 of file FastMonitoringThread.h.

std::atomic<bool> evf::FastMonitoringThread::m_stoprequest
private

Definition at line 252 of file FastMonitoringThread.h.

Referenced by stop().

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

Definition at line 253 of file FastMonitoringThread.h.

Referenced by start(), and stop().

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

Definition at line 255 of file FastMonitoringThread.h.