Sierra Toolkit Version of the Day
stk::diag::Timer Class Reference

Class Timer implements a diagnostic timer and timer container for the collection and display of execution times. More...

#include <Timer.hpp>

List of all members.

Classes

struct  Metric

Public Member Functions

 Timer (const std::string &name, const Timer parent)
 Timer (const std::string &name, const Timer parent, const TimerSet &timer_set)
 Timer (const std::string &name, TimerMask timer_mask, const Timer parent)
 Timer (const std::string &name, TimerMask timer_mask, const Timer parent, const TimerSet &timer_set)
 Timer (TimerImpl &timer_impl)
 Timer (TimerImpl *timer_impl)
 Timer (const Timer &timer)
Timeroperator= (const Timer &timer)
const TimerList & getTimerList () const
TimerList::iterator begin ()
TimerList::const_iterator begin () const
TimerList::iterator end ()
TimerList::const_iterator end () const
const std::string & getName () const
const TimerSetgetTimerSet () const
TimerMask getTimerMask () const
bool shouldRecord () const
double getSubtimerLapCount () const
template<class T >
const Metric< T > & getMetric () const
double accumulateSubtimerLapCounts () const
Timerstart ()
Timerlap ()
Timerstop ()
void checkpoint () const
Writerdump (Writer &dout) const

Friends

class TimerImpl
class TimeBlock
class TimeBlockSynchronized
void updateRootTimer (Timer)
Timer createRootTimer (const std::string &, const TimerSet &)
void deleteRootTimer (Timer)
std::vector< Timer > & findTimers (Timer, const std::string &, std::vector< Timer > &)
 Member function findTimer return a vector of timers whose tail of the dot separated name from root_time to leaf matches the specified path_tail.

Detailed Description

Class Timer implements a diagnostic timer and timer container for the collection and display of execution times.

Definition at line 175 of file Timer.hpp.


Constructor & Destructor Documentation

stk::diag::Timer::Timer ( const std::string &  name,
const Timer  parent 
)

Creates a new Timer instance.

Parameters:
namea std::string const reference to the name of the timer.
parenta Timer value of the parent timer.

Definition at line 697 of file Timer.cpp.

stk::diag::Timer::Timer ( const std::string &  name,
const Timer  parent,
const TimerSet timer_set 
)

Creates a new Timer instance.

Parameters:
namea std::string const reference to the name of the timer.
parenta Timer value of the parent timer.
timer_seta TimerSet value of the timer set used to interpret the TimerMask's of this and children timers.

Definition at line 705 of file Timer.cpp.

stk::diag::Timer::Timer ( const std::string &  name,
TimerMask  timer_mask,
const Timer  parent 
)

Creates a new Timer instance.

Parameters:
namea std::string const reference to the name of the timer.
timer_maska TimerMask value which enables this timer.
parenta Timer value of the parent timer.

Definition at line 701 of file Timer.cpp.

stk::diag::Timer::Timer ( const std::string &  name,
TimerMask  timer_mask,
const Timer  parent,
const TimerSet timer_set 
)

Creates a new Timer instance.

Parameters:
namea std::string const reference to the name of the timer.
timer_maska TimerMask value which enables this timer.
parenta Timer value of the parent timer.
timer_seta TimerSet value of the timer set used to interpret the TimerMask's of this and children timers.

Definition at line 709 of file Timer.cpp.

stk::diag::Timer::Timer ( TimerImpl &  timer_impl) [inline, explicit]

Creates the root Timer timer instance.

Definition at line 352 of file Timer.hpp.


Member Function Documentation

const std::string & stk::diag::Timer::getName ( ) const

Member function getName returns the name of the timer.

Returns:
a std::string const reference to the timer's name.

Definition at line 715 of file Timer.cpp.

const TimerSet & stk::diag::Timer::getTimerSet ( ) const

Member function getTimerMask returns the timer mask of the timer.

Returns:
a TimerMask value to the timer mask.

Definition at line 725 of file Timer.cpp.

TimerMask stk::diag::Timer::getTimerMask ( ) const

Member function getTimerMask returns the timer mask of the timer.

Returns:
a TimerMask value to the timer mask.

Definition at line 720 of file Timer.cpp.

double stk::diag::Timer::getSubtimerLapCount ( ) const

Member function getSubtimerLapCount returns the subtimer lap counter.

Returns:
a Counter value of the subtimer lap counter.

Definition at line 730 of file Timer.cpp.

template<class T >
template const Timer::Metric< HeapAlloc > & stk::diag::Timer::getMetric< HeapAlloc > ( ) const

Member function getLapCount returns the lap counter metric. The lap count metric is the number of times the stop function has been executed.

Returns:
a CounterMetric const reference of the lap counter metric.

Definition at line 741 of file Timer.cpp.

double stk::diag::Timer::accumulateSubtimerLapCounts ( ) const

Member function accumulateSubtimerLapCounts accumulates the subtimer la counts.

Returns:
an int value of the count.

Definition at line 784 of file Timer.cpp.

Timer & stk::diag::Timer::start ( )

Member function start starts the lap timer.

Returns:
a Timer reference to this timer.

Definition at line 789 of file Timer.cpp.

Timer & stk::diag::Timer::lap ( )

Member function lap sets the lap stop time.

Returns:
a Timer reference to the timer.

Definition at line 795 of file Timer.cpp.

Timer & stk::diag::Timer::stop ( )

Member function stop sets the lap stop time and sums the just completed lap time to the timer.

Returns:
a Timer reference to the timer.

Definition at line 801 of file Timer.cpp.

void stk::diag::Timer::checkpoint ( ) const

Member function checkpoint checkpoints the metrics by storing the total time in the checkpoint value.

Definition at line 807 of file Timer.cpp.

Writer & stk::diag::Timer::dump ( Writer dout) const

Member function dump writes the timer to the specified diagnostic writer.

Parameters:
douta Writer variable reference to write the timer to.
Returns:
a Writer reference to dout.

Definition at line 812 of file Timer.cpp.


Friends And Related Function Documentation

void updateRootTimer ( Timer  ) [friend]

Function updateRootTimer updates the root timers stop and total metric values with the current time.

Parameters:
root_timera Timer reference to the root timer.

Definition at line 364 of file Timer.cpp.

Timer createRootTimer ( const std::string &  ,
const TimerSet  
) [friend]

Function createRootTimer creates a root timer. Root timers are the root of a timer hierarchy. The timer_set specifies the timer groupings for this root timer. The percentage of a child timer is the ratio of that timer the its root.

Parameters:
namea std::string const reference to the name of the new root timer.
timer_seta TimerSet const reference of the timer set of the new root timer.
Returns:
a Timer value of the new root timer.

Definition at line 372 of file Timer.cpp.

void deleteRootTimer ( Timer  ) [friend]

Function deleteRootTimer deletes a root timer and all of it's children timers. All children Timers are invalidated and can no longer be used.

Parameters:
aTimer value of the root timer to delete.

Definition at line 381 of file Timer.cpp.

std::vector<Timer>& findTimers ( Timer  ,
const std::string &  ,
std::vector< Timer > &   
) [friend]

Member function findTimer return a vector of timers whose tail of the dot separated name from root_time to leaf matches the specified path_tail.

Parameters:
root_timera Timer value of the root to begin search.
path_taila std::string const reference to the dot separated tail to match.
found_timera std::vector<Timer> reference to the vector to store matching timers.
Returns:
a std::vector<Timer> reference to found_timer.

Definition at line 390 of file Timer.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends