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_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 301 of file FastTimerService.h.

Constructor & Destructor Documentation

FastTimerService::Measurement::Measurement ( )
default

Member Function Documentation

void FastTimerService::Measurement::measure ( )

Definition at line 258 of file FastTimerService.cc.

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

Referenced by FastTimerService::preModuleEvent(), and FastTimerService::preSourceEvent().

258  {
259  #ifdef DEBUG_THREAD_CONCURRENCY
260  id = std::this_thread::get_id();
261  #endif // DEBUG_THREAD_CONCURRENCY
266 }
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_store ( Resources store)

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

269  {
270  #ifdef DEBUG_THREAD_CONCURRENCY
271  assert(std::this_thread::get_id() == id);
272  #endif // DEBUG_THREAD_CONCURRENCY
273  auto new_time_thread = boost::chrono::thread_clock::now();
274  auto new_time_real = boost::chrono::high_resolution_clock::now();
275  auto new_allocated = memory_usage::allocated();
276  auto new_deallocated = memory_usage::deallocated();
277  store.time_thread = new_time_thread - time_thread;
278  store.time_real = new_time_real - time_real;
279  store.allocated = new_allocated - allocated;
280  store.deallocated = new_deallocated - deallocated;
281  time_thread = new_time_thread;
282  time_real = new_time_real;
283  allocated = new_allocated;
284  deallocated = new_deallocated;
285 }
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 313 of file FastTimerService.h.

uint64_t FastTimerService::Measurement::deallocated

Definition at line 314 of file FastTimerService.h.

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

Definition at line 312 of file FastTimerService.h.

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

Definition at line 311 of file FastTimerService.h.