CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
FastTimerService::Measurement Struct Reference

Public Member Functions

void measure ()
 
void measure_and_accumulate (AtomicResources &store)
 
void measure_and_store (Resources &store)
 
 Measurement ()
 

Public Attributes

uint64_t allocated
 
uint64_t deallocated
 
boost::chrono::high_resolution_clock::time_point time_real
 
boost::chrono::thread_clock::time_point time_thread
 

Detailed Description

Definition at line 200 of file FastTimerService.h.

Constructor & Destructor Documentation

FastTimerService::Measurement::Measurement ( )

Definition at line 302 of file FastTimerService.cc.

302  {
303  measure();
304 }

Member Function Documentation

void FastTimerService::Measurement::measure ( )

Definition at line 307 of file FastTimerService.cc.

References memory_usage::allocated(), memory_usage::deallocated(), and cmsPerfSuiteHarvest::now.

Referenced by FastTimerService::on_scheduler_entry().

307  {
308  #ifdef DEBUG_THREAD_CONCURRENCY
309  id = std::this_thread::get_id();
310  #endif // DEBUG_THREAD_CONCURRENCY
315 }
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:75
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:70
void FastTimerService::Measurement::measure_and_accumulate ( AtomicResources store)

Definition at line 337 of file FastTimerService.cc.

References memory_usage::allocated(), FastTimerService::AtomicResources::allocated, KineDebug3::count(), memory_usage::deallocated(), FastTimerService::AtomicResources::deallocated, cmsPerfSuiteHarvest::now, FastTimerService::PlotsPerElement::PlotsPerElement(), FastTimerService::AtomicResources::time_real, and FastTimerService::AtomicResources::time_thread.

Referenced by FastTimerService::on_scheduler_exit(), FastTimerService::postModuleGlobalBeginLumi(), FastTimerService::postModuleGlobalBeginRun(), FastTimerService::postModuleGlobalEndLumi(), FastTimerService::postModuleGlobalEndRun(), FastTimerService::postModuleStreamBeginLumi(), FastTimerService::postModuleStreamBeginRun(), FastTimerService::postModuleStreamEndLumi(), FastTimerService::postModuleStreamEndRun(), FastTimerService::postSourceLumi(), FastTimerService::postSourceRun(), FastTimerService::preModuleEvent(), FastTimerService::preModuleGlobalBeginLumi(), FastTimerService::preModuleGlobalBeginRun(), FastTimerService::preModuleGlobalEndLumi(), FastTimerService::preModuleGlobalEndRun(), FastTimerService::preModuleStreamBeginLumi(), FastTimerService::preModuleStreamBeginRun(), FastTimerService::preModuleStreamEndLumi(), FastTimerService::preModuleStreamEndRun(), FastTimerService::preSourceLumi(), and FastTimerService::preSourceRun().

337  {
338  #ifdef DEBUG_THREAD_CONCURRENCY
339  assert(std::this_thread::get_id() == id);
340  #endif // DEBUG_THREAD_CONCURRENCY
341  auto new_time_thread = boost::chrono::thread_clock::now();
342  auto new_time_real = boost::chrono::high_resolution_clock::now();
343  auto new_allocated = memory_usage::allocated();
344  auto new_deallocated = memory_usage::deallocated();
345  store.time_thread += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_thread - time_thread).count();
346  store.time_real += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_real - time_real).count();
347  store.allocated += new_allocated - allocated;
348  store.deallocated += new_deallocated - deallocated;
349  time_thread = new_time_thread;
350  time_real = new_time_real;
351  allocated = new_allocated;
352  deallocated = new_deallocated;
353 }
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:75
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:70
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
void FastTimerService::Measurement::measure_and_store ( Resources store)

Definition at line 318 of file FastTimerService.cc.

References memory_usage::allocated(), FastTimerService::Resources::allocated, memory_usage::deallocated(), FastTimerService::Resources::deallocated, cmsPerfSuiteHarvest::now, FastTimerService::Resources::time_real, and FastTimerService::Resources::time_thread.

Referenced by FastTimerService::postModuleEvent(), and FastTimerService::postSourceEvent().

318  {
319  #ifdef DEBUG_THREAD_CONCURRENCY
320  assert(std::this_thread::get_id() == id);
321  #endif // DEBUG_THREAD_CONCURRENCY
322  auto new_time_thread = boost::chrono::thread_clock::now();
323  auto new_time_real = boost::chrono::high_resolution_clock::now();
324  auto new_allocated = memory_usage::allocated();
325  auto new_deallocated = memory_usage::deallocated();
326  store.time_thread = new_time_thread - time_thread;
327  store.time_real = new_time_real - time_real;
328  store.allocated = new_allocated - allocated;
329  store.deallocated = new_deallocated - deallocated;
330  time_thread = new_time_thread;
331  time_real = new_time_real;
332  allocated = new_allocated;
333  deallocated = new_deallocated;
334 }
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:75
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:70

Member Data Documentation

uint64_t FastTimerService::Measurement::allocated

Definition at line 213 of file FastTimerService.h.

uint64_t FastTimerService::Measurement::deallocated

Definition at line 214 of file FastTimerService.h.

boost::chrono::high_resolution_clock::time_point FastTimerService::Measurement::time_real

Definition at line 212 of file FastTimerService.h.

boost::chrono::thread_clock::time_point FastTimerService::Measurement::time_thread

Definition at line 211 of file FastTimerService.h.