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 (Resources &store)
 
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 184 of file FastTimerService.h.

Constructor & Destructor Documentation

FastTimerService::Measurement::Measurement ( )

Definition at line 266 of file FastTimerService.cc.

Member Function Documentation

void FastTimerService::Measurement::measure ( )

Definition at line 268 of file FastTimerService.cc.

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

Referenced by FastTimerService::on_scheduler_entry().

268  {
269 #ifdef DEBUG_THREAD_CONCURRENCY
270  id = std::this_thread::get_id();
271 #endif // DEBUG_THREAD_CONCURRENCY
276 }
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:64
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:62
void FastTimerService::Measurement::measure_and_accumulate ( Resources store)

Definition at line 296 of file FastTimerService.cc.

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

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

296  {
297 #ifdef DEBUG_THREAD_CONCURRENCY
298  assert(std::this_thread::get_id() == id);
299 #endif // DEBUG_THREAD_CONCURRENCY
300  auto new_time_thread = boost::chrono::thread_clock::now();
301  auto new_time_real = boost::chrono::high_resolution_clock::now();
302  auto new_allocated = memory_usage::allocated();
303  auto new_deallocated = memory_usage::deallocated();
304  store.time_thread += new_time_thread - time_thread;
305  store.time_real += new_time_real - time_real;
306  store.allocated += new_allocated - allocated;
307  store.deallocated += new_deallocated - deallocated;
308  time_thread = new_time_thread;
309  time_real = new_time_real;
310  allocated = new_allocated;
311  deallocated = new_deallocated;
312 }
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:64
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:62
void FastTimerService::Measurement::measure_and_accumulate ( AtomicResources store)

Definition at line 314 of file FastTimerService.cc.

References memory_usage::allocated(), KineDebug3::count(), memory_usage::deallocated(), and fileCollector::now.

314  {
315 #ifdef DEBUG_THREAD_CONCURRENCY
316  assert(std::this_thread::get_id() == id);
317 #endif // DEBUG_THREAD_CONCURRENCY
318  auto new_time_thread = boost::chrono::thread_clock::now();
319  auto new_time_real = boost::chrono::high_resolution_clock::now();
320  auto new_allocated = memory_usage::allocated();
321  auto new_deallocated = memory_usage::deallocated();
322  store.time_thread += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_thread - time_thread).count();
323  store.time_real += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_real - time_real).count();
324  store.allocated += new_allocated - allocated;
325  store.deallocated += new_deallocated - deallocated;
326  time_thread = new_time_thread;
327  time_real = new_time_real;
328  allocated = new_allocated;
329  deallocated = new_deallocated;
330 }
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:64
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:62
void FastTimerService::Measurement::measure_and_store ( Resources store)

Definition at line 278 of file FastTimerService.cc.

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

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

278  {
279 #ifdef DEBUG_THREAD_CONCURRENCY
280  assert(std::this_thread::get_id() == id);
281 #endif // DEBUG_THREAD_CONCURRENCY
282  auto new_time_thread = boost::chrono::thread_clock::now();
283  auto new_time_real = boost::chrono::high_resolution_clock::now();
284  auto new_allocated = memory_usage::allocated();
285  auto new_deallocated = memory_usage::deallocated();
286  store.time_thread = new_time_thread - time_thread;
287  store.time_real = new_time_real - time_real;
288  store.allocated = new_allocated - allocated;
289  store.deallocated = new_deallocated - deallocated;
290  time_thread = new_time_thread;
291  time_real = new_time_real;
292  allocated = new_allocated;
293  deallocated = new_deallocated;
294 }
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:64
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:62

Member Data Documentation

uint64_t FastTimerService::Measurement::allocated

Definition at line 201 of file FastTimerService.h.

uint64_t FastTimerService::Measurement::deallocated

Definition at line 202 of file FastTimerService.h.

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

Definition at line 200 of file FastTimerService.h.

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

Definition at line 199 of file FastTimerService.h.