CMS 3D CMS Logo

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::FastMonitorjsonMonitor_
 
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 115 of file FastMonitoringThread.h.

Constructor & Destructor Documentation

◆ FastMonitoringThread()

evf::FastMonitoringThread::FastMonitoringThread ( )
inline

Definition at line 222 of file FastMonitoringThread.h.

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

◆ ~FastMonitoringThread()

evf::FastMonitoringThread::~FastMonitoringThread ( )
inline

Definition at line 243 of file FastMonitoringThread.h.

References stop().

Member Function Documentation

◆ resetFastMonitor()

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

Definition at line 224 of file FastMonitoringThread.h.

References jsonMonitor_, and AlCaHLTBitMon_QueryRunRegistry::string.

224  {
225  std::string defGroup = "data";
226  jsonMonitor_ = std::make_unique<jsoncollector::FastMonitor>(microStateDefPath, defGroup, false);
227  if (!fastMicroStateDefPath.empty())
228  jsonMonitor_->addFastPathDefinition(fastMicroStateDefPath, defGroup, false);
229  }
std::unique_ptr< jsoncollector::FastMonitor > jsonMonitor_

◆ start()

void evf::FastMonitoringThread::start ( void(FastMonitoringService::*)()  fp,
FastMonitoringService cp 
)
inline

Definition at line 231 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().

231  {
232  assert(!m_thread);
233  m_thread = std::make_shared<std::thread>(fp, cp);
234  }
std::shared_ptr< std::thread > m_thread
assert(be >=bs)
def cp(fromDir, toDir, listOfFiles, overwrite=False, smallList=False)

◆ stop()

void evf::FastMonitoringThread::stop ( )
inline

Definition at line 235 of file FastMonitoringThread.h.

References m_stoprequest, and m_thread.

Referenced by ~FastMonitoringThread().

235  {
236  if (m_thread.get()) {
237  m_stoprequest = true;
238  m_thread->join();
239  m_thread.reset();
240  }
241  }
std::shared_ptr< std::thread > m_thread
std::atomic< bool > m_stoprequest

Friends And Related Function Documentation

◆ FastMonitoringService

friend class FastMonitoringService
friend

Definition at line 253 of file FastMonitoringThread.h.

Member Data Documentation

◆ jsonMonitor_

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

Definition at line 251 of file FastMonitoringThread.h.

Referenced by resetFastMonitor().

◆ m_data

MonitorData evf::FastMonitoringThread::m_data
private

Definition at line 248 of file FastMonitoringThread.h.

◆ m_stoprequest

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

Definition at line 246 of file FastMonitoringThread.h.

Referenced by stop().

◆ m_thread

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

Definition at line 247 of file FastMonitoringThread.h.

Referenced by start(), and stop().

◆ monlock_

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

Definition at line 249 of file FastMonitoringThread.h.