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

Constructor & Destructor Documentation

FastTimerService::Measurement::Measurement ( )

Definition at line 312 of file FastTimerService.cc.

312  {
313  measure();
314 }

Member Function Documentation

void FastTimerService::Measurement::measure ( )

Definition at line 317 of file FastTimerService.cc.

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

Referenced by FastTimerService::on_scheduler_entry().

317  {
318  #ifdef DEBUG_THREAD_CONCURRENCY
319  id = std::this_thread::get_id();
320  #endif // DEBUG_THREAD_CONCURRENCY
325 }
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 347 of file FastTimerService.cc.

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

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

347  {
348  #ifdef DEBUG_THREAD_CONCURRENCY
349  assert(std::this_thread::get_id() == id);
350  #endif // DEBUG_THREAD_CONCURRENCY
351  auto new_time_thread = boost::chrono::thread_clock::now();
352  auto new_time_real = boost::chrono::high_resolution_clock::now();
353  auto new_allocated = memory_usage::allocated();
354  auto new_deallocated = memory_usage::deallocated();
355  store.time_thread += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_thread - time_thread).count();
356  store.time_real += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_real - time_real).count();
357  store.allocated += new_allocated - allocated;
358  store.deallocated += new_deallocated - deallocated;
359  time_thread = new_time_thread;
360  time_real = new_time_real;
361  allocated = new_allocated;
362  deallocated = new_deallocated;
363 }
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 328 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().

328  {
329  #ifdef DEBUG_THREAD_CONCURRENCY
330  assert(std::this_thread::get_id() == id);
331  #endif // DEBUG_THREAD_CONCURRENCY
332  auto new_time_thread = boost::chrono::thread_clock::now();
333  auto new_time_real = boost::chrono::high_resolution_clock::now();
334  auto new_allocated = memory_usage::allocated();
335  auto new_deallocated = memory_usage::deallocated();
336  store.time_thread = new_time_thread - time_thread;
337  store.time_real = new_time_real - time_real;
338  store.allocated = new_allocated - allocated;
339  store.deallocated = new_deallocated - deallocated;
340  time_thread = new_time_thread;
341  time_real = new_time_real;
342  allocated = new_allocated;
343  deallocated = new_deallocated;
344 }
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 293 of file FastTimerService.h.

uint64_t FastTimerService::Measurement::deallocated

Definition at line 294 of file FastTimerService.h.

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

Definition at line 292 of file FastTimerService.h.

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

Definition at line 291 of file FastTimerService.h.