| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

ChronoEntity Class Reference

a small helper class for implementation of ChronoStatSvc service, It also could be used as some local timer More...

#include <GaudiKernel/ChronoEntity.h>

Collaboration diagram for ChronoEntity:

[legend]
List of all members.

Public Member Functions

 ChronoEntity ()
 default constructor
 ~ChronoEntity ()
 destructor
IChronoSvc::ChronoStatus start ()
 start the current chrono
IChronoSvc::ChronoStatus stop ()
 stop the chrono
IChronoSvc::ChronoTime delta (IChronoSvc::ChronoType type) const
 return the last delta-time of type "type"
IChronoSvc::ChronoStatus status () const
 return the status of chrono
unsigned long nOfMeasurements () const
 number of chrono measurements
double uMinimalTime () const
 minimal measurement for user time
double kMinimalTime () const
 minimal measurement for kernel time
double eMinimalTime () const
 minimal measurement for ellapsed time
double uMaximalTime () const
 maximal measurement for user time
double kMaximalTime () const
 maximal measurement for kernel time
double eMaximalTime () const
 maximal measurement for ellapsed time
double uTotalTime () const
 total user time
double kTotalTime () const
 total Kernel time
double eTotalTime () const
 total Elapsed time
double totalTime () const
 total time
double kMeanTime () const
 average Kernel Time
double uMeanTime () const
 average User Time
double eMeanTime () const
 average Elapsed Time
double kRMSTime () const
 r.m.s Kernel Time
double uRMSTime () const
 r.m.s User Time
double eRMSTime () const
 r.m.s Elapsed Time
double kMeanErrorTime () const
 error in mean Kernel time
double uMeanErrorTime () const
 error in mean User time
double eMeanErrorTime () const
 error in mean Elapsed time
bool operator< (const ChronoEntity &entity) const
 comparison operator
std::string outputUserTime () const
 print the chrono ;
std::string outputSystemTime () const
 print the chrono ;
std::string outputElapsedTime () const
 print the chrono ;
std::string outputUserTime (const std::string &fmt, System::TimeType unit) const
 print the chrono according the format and units
std::string outputSystemTime (const std::string &fmt, System::TimeType unit) const
 print the chrono according the format and units
std::string outputElapsedTime (const std::string &fmt, System::TimeType unit) const
 print the chrono according the format and units
std::string outputTime (IChronoSvc::ChronoType typ, const std::string &fmt, System::TimeType unit) const
 print the chrono according the format and units

Protected Member Functions

std::string format (const double total, const double minimal, const double mean, const double rms, const double maximal, const unsigned long number) const
 format

Private Attributes

IChronoSvc::ChronoStatus m_status
 current status of this chrono object;
IChronoSvc::ChronoTime m_delta_user
 delta user time
IChronoSvc::ChronoTime m_delta_kernel
 delta Kernel time
IChronoSvc::ChronoTime m_delta_elapsed
 delta Elapsed time
IChronoSvc::ChronoTime m_start_user
 start stamp for current measurement of user time
IChronoSvc::ChronoTime m_start_kernel
 start stamp for current measurement of Kernel time
IChronoSvc::ChronoTime m_start_elapsed
 start stamp for current measurement of Elapsed time
StatEntity m_user
 the actual storage of "user" time
StatEntity m_kernel
 the actual storage of "kernel" time
StatEntity m_elapsed
 the actual storage of "elapsed" time

Detailed Description

a small helper class for implementation of ChronoStatSvc service, It also could be used as some local timer

Author:
Vanya BELYAEV Ivan.Belyaev@itep.ru
Date:
December 1, 1999

Definition at line 23 of file ChronoEntity.h.


Constructor & Destructor Documentation

ChronoEntity::ChronoEntity (  ) 

default constructor

ChronoEntity::~ChronoEntity (  )  [inline]

destructor

Definition at line 29 of file ChronoEntity.h.

00029 {};


Member Function Documentation

IChronoSvc::ChronoStatus ChronoEntity::start (  ) 

start the current chrono

IChronoSvc::ChronoStatus ChronoEntity::stop (  ) 

stop the chrono

IChronoSvc::ChronoTime ChronoEntity::delta ( IChronoSvc::ChronoType  type  )  const [inline]

return the last delta-time of type "type"

Definition at line 303 of file ChronoEntity.h.

00304 {
00305   const IChronoSvc::ChronoTime result = -1 ;
00306   switch ( type ) 
00307   {
00308   case IChronoSvc::USER    : return m_delta_user    ;
00309   case IChronoSvc::KERNEL  : return m_delta_kernel  ;
00310   case IChronoSvc::ELAPSED : return m_delta_elapsed ;
00311   default                  : return result          ;
00312   }
00313   return result;
00314 }

IChronoSvc::ChronoStatus ChronoEntity::status (  )  const [inline]

return the status of chrono

Definition at line 197 of file ChronoEntity.h.

00197 { return m_status; }

unsigned long ChronoEntity::nOfMeasurements (  )  const [inline]

number of chrono measurements

Definition at line 202 of file ChronoEntity.h.

00202 { return m_user   . nEntries() ; }

double ChronoEntity::uMinimalTime (  )  const [inline]

minimal measurement for user time

Definition at line 206 of file ChronoEntity.h.

00207 { return m_user   . flagMin () ; }

double ChronoEntity::kMinimalTime (  )  const [inline]

minimal measurement for kernel time

Definition at line 212 of file ChronoEntity.h.

00212 { return m_kernel . flagMin () ; }

double ChronoEntity::eMinimalTime (  )  const [inline]

minimal measurement for ellapsed time

Definition at line 217 of file ChronoEntity.h.

00217 { return m_elapsed. flagMin () ; }

double ChronoEntity::uMaximalTime (  )  const [inline]

maximal measurement for user time

Definition at line 222 of file ChronoEntity.h.

00222 { return m_user   . flagMax () ; }

double ChronoEntity::kMaximalTime (  )  const [inline]

maximal measurement for kernel time

Definition at line 227 of file ChronoEntity.h.

00227 { return m_kernel . flagMax () ; }

double ChronoEntity::eMaximalTime (  )  const [inline]

maximal measurement for ellapsed time

Definition at line 232 of file ChronoEntity.h.

00232 { return m_elapsed . flagMax () ; }

double ChronoEntity::uTotalTime (  )  const [inline]

total user time

Definition at line 237 of file ChronoEntity.h.

00237 { return m_user    . flag () ; }

double ChronoEntity::kTotalTime (  )  const [inline]

total Kernel time

Definition at line 242 of file ChronoEntity.h.

00242 { return m_kernel  . flag () ; }

double ChronoEntity::eTotalTime (  )  const [inline]

total Elapsed time

Definition at line 247 of file ChronoEntity.h.

00247 { return m_elapsed . flag () ; }

double ChronoEntity::totalTime (  )  const [inline]

total time

Definition at line 252 of file ChronoEntity.h.

00253 { return uTotalTime() + kTotalTime()  ; }

double ChronoEntity::kMeanTime (  )  const [inline]

average Kernel Time

Definition at line 258 of file ChronoEntity.h.

00258 { return m_kernel  . flagMean () ; }

double ChronoEntity::uMeanTime (  )  const [inline]

average User Time

Definition at line 263 of file ChronoEntity.h.

00263 { return m_user    . flagMean () ; }

double ChronoEntity::eMeanTime (  )  const [inline]

average Elapsed Time

Definition at line 268 of file ChronoEntity.h.

00268 { return m_elapsed . flagMean () ; }

double ChronoEntity::kRMSTime (  )  const [inline]

r.m.s Kernel Time

Definition at line 273 of file ChronoEntity.h.

00273 { return m_kernel  . flagRMS  () ; }

double ChronoEntity::uRMSTime (  )  const [inline]

r.m.s User Time

Definition at line 278 of file ChronoEntity.h.

00278 { return m_user    . flagRMS  () ; }

double ChronoEntity::eRMSTime (  )  const [inline]

r.m.s Elapsed Time

Definition at line 283 of file ChronoEntity.h.

00283 { return m_elapsed . flagRMS () ; }

double ChronoEntity::kMeanErrorTime (  )  const [inline]

error in mean Kernel time

Definition at line 288 of file ChronoEntity.h.

00288 { return m_kernel  . flagMeanErr () ; }

double ChronoEntity::uMeanErrorTime (  )  const [inline]

error in mean User time

Definition at line 293 of file ChronoEntity.h.

00293 { return m_user    . flagMeanErr () ; }

double ChronoEntity::eMeanErrorTime (  )  const [inline]

error in mean Elapsed time

Definition at line 298 of file ChronoEntity.h.

00298 { return m_elapsed . flagMeanErr () ; }

bool ChronoEntity::operator< ( const ChronoEntity entity  )  const

comparison operator

std::string ChronoEntity::outputUserTime (  )  const

print the chrono ;

std::string ChronoEntity::outputSystemTime (  )  const

print the chrono ;

std::string ChronoEntity::outputElapsedTime (  )  const

print the chrono ;

std::string ChronoEntity::outputUserTime ( const std::string &  fmt,
System::TimeType  unit 
) const [inline]

print the chrono according the format and units

Parameters:
fmt the format string
unit the unit
Returns:
the string representations
See also:
boost::format

Definition at line 325 of file ChronoEntity.h.

00327 {
00328   return outputTime ( IChronoSvc::USER , fmt , unit ) ;
00329 }

std::string ChronoEntity::outputSystemTime ( const std::string &  fmt,
System::TimeType  unit 
) const [inline]

print the chrono according the format and units

Parameters:
fmt the format string
unit the unit
Returns:
the string representations
See also:
boost::format

Definition at line 340 of file ChronoEntity.h.

00342 {
00343   return outputTime ( IChronoSvc::KERNEL , fmt , unit ) ;
00344 }  

std::string ChronoEntity::outputElapsedTime ( const std::string &  fmt,
System::TimeType  unit 
) const [inline]

print the chrono according the format and units

Parameters:
fmt the format string
unit the unit
Returns:
the string representations
See also:
boost::format

Definition at line 355 of file ChronoEntity.h.

00357 {
00358   return outputTime ( IChronoSvc::ELAPSED , fmt , unit ) ;
00359 }  

std::string ChronoEntity::outputTime ( IChronoSvc::ChronoType  typ,
const std::string &  fmt,
System::TimeType  unit 
) const

print the chrono according the format and units

The format fields are:

  1. number of entries
  2. total time (in the specified units)
  3. mean time (in the specified units)
  4. r.m.s. time (in the specified units)
  5. error in mean time (in the specified units)
  6. minimal time (in the specified units)
  7. maximal time (in the specified units)

Parameters:
typ the chrono type
fmt the format string
unit the unit
Returns:
the string representations
See also:
boost::format

std::string ChronoEntity::format ( const double  total,
const double  minimal,
const double  mean,
const double  rms,
const double  maximal,
const unsigned long  number 
) const [protected]

format


Member Data Documentation

IChronoSvc::ChronoStatus ChronoEntity::m_status [private]

current status of this chrono object;

Definition at line 172 of file ChronoEntity.h.

IChronoSvc::ChronoTime ChronoEntity::m_delta_user [private]

delta user time

Definition at line 174 of file ChronoEntity.h.

IChronoSvc::ChronoTime ChronoEntity::m_delta_kernel [private]

delta Kernel time

Definition at line 176 of file ChronoEntity.h.

IChronoSvc::ChronoTime ChronoEntity::m_delta_elapsed [private]

delta Elapsed time

Definition at line 178 of file ChronoEntity.h.

IChronoSvc::ChronoTime ChronoEntity::m_start_user [private]

start stamp for current measurement of user time

Definition at line 180 of file ChronoEntity.h.

IChronoSvc::ChronoTime ChronoEntity::m_start_kernel [private]

start stamp for current measurement of Kernel time

Definition at line 182 of file ChronoEntity.h.

IChronoSvc::ChronoTime ChronoEntity::m_start_elapsed [private]

start stamp for current measurement of Elapsed time

Definition at line 184 of file ChronoEntity.h.

StatEntity ChronoEntity::m_user [private]

the actual storage of "user" time

Definition at line 186 of file ChronoEntity.h.

StatEntity ChronoEntity::m_kernel [private]

the actual storage of "kernel" time

Definition at line 188 of file ChronoEntity.h.

StatEntity ChronoEntity::m_elapsed [private]

the actual storage of "elapsed" time

Definition at line 190 of file ChronoEntity.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:57:06 2011 for GaudiKernel by doxygen 1.4.7