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:

Public Member Functions

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

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 More...
 
std::string format (const double total, const double minimal, const double mean, const double rms, const double maximal, const unsigned long number) const
 format More...
 

Private Attributes

IChronoSvc::ChronoStatus m_status = IChronoSvc::UNKNOWN
 current status of this chrono object; More...
 
System::ProcessTime m_delta
 delta process times More...
 
System::ProcessTime m_start
 start stamp for current measurement of process times More...
 
StatEntity m_user
 the actual storage of "user" time More...
 
StatEntity m_kernel
 the actual storage of "kernel" time More...
 
StatEntity m_elapsed
 the actual storage of "elapsed" time More...
 

Static Private Attributes

static const System::TimeType TimeUnit = System::microSec
 internal unit used for the system time conversion (microseconds) More...
 

Detailed Description

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

Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru
Date
December 1, 1999

Definition at line 21 of file ChronoEntity.h.

Constructor & Destructor Documentation

ChronoEntity::ChronoEntity ( )
default

default constructor

ChronoEntity::ChronoEntity ( )
default

default constructor

Member Function Documentation

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

return the last delta-time of type "type"

Definition at line 292 of file ChronoEntity.h.

293 {
294  const IChronoSvc::ChronoTime result = -1 ;
295  switch ( type )
296  {
297  case IChronoSvc::USER : return m_delta.userTime<TimeUnit>();
300  default : return result;
301  }
302  // cannot reach this point
303 }
TimeValueType kernelTime() const
Retrieve the kernel time in the requested unit.
Definition: Timing.h:146
TimeValueType userTime() const
Retrieve the user time in the requested unit.
Definition: Timing.h:150
System::ProcessTime m_delta
delta process times
Definition: ChronoEntity.h:169
double ChronoTime
Type of the delta-time.
Definition: IChronoSvc.h:41
TimeValueType elapsedTime() const
Retrieve the elapsed time in the requested unit.
Definition: Timing.h:154
static const System::TimeType TimeUnit
internal unit used for the system time conversion (microseconds)
Definition: ChronoEntity.h:179
string type
Definition: gaudirun.py:151
IChronoSvc::ChronoTime ChronoEntity::delta ( IChronoSvc::ChronoType  type) const
inline

return the last delta-time of type "type"

double ChronoEntity::eMaximalTime ( ) const
inline

maximal measurement for elapsed time

Definition at line 221 of file ChronoEntity.h.

221 { return m_elapsed . flagMax () ; }
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:177
double ChronoEntity::eMaximalTime ( ) const
inline

maximal measurement for elapsed time

double ChronoEntity::eMeanErrorTime ( ) const
inline

error in mean Elapsed time

Definition at line 287 of file ChronoEntity.h.

287 { return m_elapsed . flagMeanErr () ; }
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:177
double ChronoEntity::eMeanErrorTime ( ) const
inline

error in mean Elapsed time

double ChronoEntity::eMeanTime ( ) const
inline

average Elapsed Time

Definition at line 257 of file ChronoEntity.h.

257 { return m_elapsed . flagMean () ; }
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:177
double ChronoEntity::eMeanTime ( ) const
inline

average Elapsed Time

double ChronoEntity::eMinimalTime ( ) const
inline

minimal measurement for elapsed time

double ChronoEntity::eMinimalTime ( ) const
inline

minimal measurement for elapsed time

Definition at line 206 of file ChronoEntity.h.

206 { return m_elapsed. flagMin () ; }
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:177
double ChronoEntity::eRMSTime ( ) const
inline

r.m.s Elapsed Time

Definition at line 272 of file ChronoEntity.h.

272 { return m_elapsed . flagRMS () ; }
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:177
double ChronoEntity::eRMSTime ( ) const
inline

r.m.s Elapsed Time

double ChronoEntity::eTotalTime ( ) const
inline

total Elapsed time

double ChronoEntity::eTotalTime ( ) const
inline

total Elapsed time

Definition at line 236 of file ChronoEntity.h.

236 { return m_elapsed . flag () ; }
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:177
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

Todo:
: cache the format
Todo:
: cache the format

Definition at line 124 of file ChronoEntity.cpp.

130 {
131 
133  boost::format fmt("Tot=%2$5.3g%1$s %4$43s #=%3$3lu");
134 
135  static const auto tbl = { std::make_tuple( 500, microsecond, " [us]" ),
136  std::make_tuple( 500, millisecond, " [ms]" ),
137  std::make_tuple( 500, second, " [s]" ),
138  std::make_tuple( 500, minute, "[min]" ),
139  std::make_tuple( 500, hour, " [h]" ),
140  std::make_tuple( 10, day, "[day]" ),
141  std::make_tuple( 5, week, " [w]" ),
142  std::make_tuple( 20, month, "[mon]" ),
143  std::make_tuple( -1, year, " [y]" )};
144 
145  auto i = std::find_if( std::begin(tbl), std::prev(std::end(tbl)),
146  [&]( const std::tuple<int,double,const char*>& i) {
147  return total < std::get<0>(i)*std::get<1>(i);
148  });
149  long double unit = std::get<1>(*i) ;
150  fmt % std::get<2>(*i) % (double) (total / unit) % number;
151 
152  if( number > 1 )
153  {
155  boost::format fmt1("Ave/Min/Max=%2$5.3g(+-%3$5.3g)/%4$5.3g/%5$5.3g%1$s");
156  auto i = std::find_if( std::begin(tbl), std::prev(std::end(tbl)),
157  [&]( const std::tuple<int,double,const char*>& i) {
158  return total < std::get<0>(i)*std::get<1>(i);
159  });
160  unit = std::get<1>(*i);
161  fmt1 % std::get<2>(*i) % (double) ( mean / unit ) % (double) ( rms / unit )
162  % (double) ( minimal / unit ) % (double) ( maximal / unit );
163  fmt % fmt1.str();
164  } else {
165  fmt % "";
166  }
167 
168  return fmt.str();
169 }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
constexpr double microsecond
constexpr double second
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
constexpr double millisecond
list i
Definition: ana.py:128
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
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

double ChronoEntity::kMaximalTime ( ) const
inline

maximal measurement for kernel time

double ChronoEntity::kMaximalTime ( ) const
inline

maximal measurement for kernel time

Definition at line 216 of file ChronoEntity.h.

216 { return m_kernel . flagMax () ; }
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:175
double ChronoEntity::kMeanErrorTime ( ) const
inline

error in mean Kernel time

Definition at line 277 of file ChronoEntity.h.

277 { return m_kernel . flagMeanErr () ; }
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:175
double ChronoEntity::kMeanErrorTime ( ) const
inline

error in mean Kernel time

double ChronoEntity::kMeanTime ( ) const
inline

average Kernel Time

Definition at line 247 of file ChronoEntity.h.

247 { return m_kernel . flagMean () ; }
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:175
double ChronoEntity::kMeanTime ( ) const
inline

average Kernel Time

double ChronoEntity::kMinimalTime ( ) const
inline

minimal measurement for kernel time

double ChronoEntity::kMinimalTime ( ) const
inline

minimal measurement for kernel time

Definition at line 201 of file ChronoEntity.h.

201 { return m_kernel . flagMin () ; }
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:175
double ChronoEntity::kRMSTime ( ) const
inline

r.m.s Kernel Time

Definition at line 262 of file ChronoEntity.h.

262 { return m_kernel . flagRMS () ; }
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:175
double ChronoEntity::kRMSTime ( ) const
inline

r.m.s Kernel Time

double ChronoEntity::kTotalTime ( ) const
inline

total Kernel time

double ChronoEntity::kTotalTime ( ) const
inline

total Kernel time

Definition at line 231 of file ChronoEntity.h.

231 { return m_kernel . flag () ; }
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:175
unsigned long ChronoEntity::nOfMeasurements ( ) const
inline

number of chrono measurements

Definition at line 191 of file ChronoEntity.h.

191 { return m_user . nEntries() ; }
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:173
unsigned long ChronoEntity::nOfMeasurements ( ) const
inline

number of chrono measurements

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

comparison operator

Definition at line 173 of file ChronoEntity.cpp.

174 {
175  return
176  ( &e == this ) ? false :
177  ( totalTime () < e.totalTime () ) ? true :
178  ( totalTime () > e.totalTime () ) ? false :
179  ( m_user < e.m_user ) ? true :
180  ( e.m_user < m_user ) ? false :
181  ( m_kernel < e.m_kernel ) ? true :
182  ( e.m_kernel < m_kernel ) ? false :
183  ( m_elapsed < e.m_elapsed ) ? true :
184  ( e.m_elapsed < m_elapsed ) ? false : false ;
185 }
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:177
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:173
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:175
double totalTime() const
total time
Definition: ChronoEntity.h:241
bool ChronoEntity::operator< ( const ChronoEntity entity) const

comparison operator

std::string ChronoEntity::outputElapsedTime ( ) const

print the chrono ;

Definition at line 110 of file ChronoEntity.cpp.

111 {
112  return "TimeElapsed: " + format
113  ( eTotalTime () ,
114  eMinimalTime () ,
115  eMeanTime () ,
116  eRMSTime () ,
117  eMaximalTime () ,
118  nOfMeasurements() );
119 }
double eMinimalTime() const
minimal measurement for elapsed time
Definition: ChronoEntity.h:206
double eMeanTime() const
average Elapsed Time
Definition: ChronoEntity.h:257
double eRMSTime() const
r.m.s Elapsed Time
Definition: ChronoEntity.h:272
std::string format(const double total, const double minimal, const double mean, const double rms, const double maximal, const unsigned long number) const
format
double eMaximalTime() const
maximal measurement for elapsed time
Definition: ChronoEntity.h:221
unsigned long nOfMeasurements() const
number of chrono measurements
Definition: ChronoEntity.h:191
double eTotalTime() const
total Elapsed time
Definition: ChronoEntity.h:236
std::string ChronoEntity::outputElapsedTime ( ) const

print the chrono ;

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

print the chrono according the format and units

Parameters
fmtthe format string
unitthe unit
Returns
the string representations
See also
boost::format
std::string ChronoEntity::outputElapsedTime ( const std::string &  fmt,
System::TimeType  unit 
) const
inline

print the chrono according the format and units

Parameters
fmtthe format string
unitthe unit
Returns
the string representations
See also
boost::format

Definition at line 344 of file ChronoEntity.h.

346 {
347  return outputTime ( IChronoSvc::ELAPSED , fmt , unit ) ;
348 }
std::string outputTime(IChronoSvc::ChronoType typ, const std::string &fmt, System::TimeType unit) const
print the chrono according the format and units
std::string ChronoEntity::outputSystemTime ( ) const

print the chrono ;

std::string ChronoEntity::outputSystemTime ( ) const

print the chrono ;

Definition at line 98 of file ChronoEntity.cpp.

99 {
100  return "Time System : " + format
101  ( kTotalTime () ,
102  kMinimalTime () ,
103  kMeanTime () ,
104  kRMSTime () ,
105  kMaximalTime () ,
106  nOfMeasurements() );
107 }
double kMaximalTime() const
maximal measurement for kernel time
Definition: ChronoEntity.h:216
double kTotalTime() const
total Kernel time
Definition: ChronoEntity.h:231
double kMinimalTime() const
minimal measurement for kernel time
Definition: ChronoEntity.h:201
double kRMSTime() const
r.m.s Kernel Time
Definition: ChronoEntity.h:262
double kMeanTime() const
average Kernel Time
Definition: ChronoEntity.h:247
std::string format(const double total, const double minimal, const double mean, const double rms, const double maximal, const unsigned long number) const
format
unsigned long nOfMeasurements() const
number of chrono measurements
Definition: ChronoEntity.h:191
std::string ChronoEntity::outputSystemTime ( const std::string &  fmt,
System::TimeType  unit 
) const
inline

print the chrono according the format and units

Parameters
fmtthe format string
unitthe unit
Returns
the string representations
See also
boost::format
std::string ChronoEntity::outputSystemTime ( const std::string &  fmt,
System::TimeType  unit 
) const
inline

print the chrono according the format and units

Parameters
fmtthe format string
unitthe unit
Returns
the string representations
See also
boost::format

Definition at line 329 of file ChronoEntity.h.

331 {
332  return outputTime ( IChronoSvc::KERNEL , fmt , unit ) ;
333 }
std::string outputTime(IChronoSvc::ChronoType typ, const std::string &fmt, System::TimeType unit) const
print the chrono according the format and units
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
typthe chrono type
fmtthe format string
unitthe unit
Returns
the string representations
See also
boost::format

Definition at line 196 of file ChronoEntity.cpp.

199 {
200  boost::format _fmt ( fmt ) ;
201  // allow various number of arguments
202  using namespace boost::io ;
203  _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
204  //
205  double _unit = microsecond ;
206  switch ( unit )
207  {
208  case System::Year : _unit = year ; break ;
209  case System::Month : _unit = month ; break ;
210  case System::Day : _unit = day ; break ;
211  case System::Hour : _unit = hour ; break ;
212  case System::Min : _unit = minute ; break ;
213  case System::Sec : _unit = second ; break ;
214  case System::milliSec : _unit = millisecond ; break ;
215  case System::microSec : _unit = microsecond ; break ;
216  case System::nanoSec : _unit = nanosecond ; break ;
217  default : _unit = microsecond ; break ;
218  }
219  //
220  const StatEntity* stat = &m_user;
221  switch ( typ )
222  {
223  case IChronoSvc::USER : stat = &m_user ; break ;
224  case IChronoSvc::KERNEL : stat = &m_kernel ; break ;
225  case IChronoSvc::ELAPSED : stat = &m_elapsed ; break ;
226  default : stat = &m_user ; break ;
227  }
228  //
229  _fmt
230  % ( stat -> nEntries () ) // %1 : #entries
231  % ( stat -> flag () / _unit ) // %2 : total time
232  % ( stat -> flagMean () / _unit ) // %3 : mean time
233  % ( stat -> flagRMS () / _unit ) // %4 : RMS time
234  % ( stat -> flagMeanErr () / _unit ) // %5 : error in mean time
235  % ( stat -> flagMin () / _unit ) // %6 : minimal time
236  % ( stat -> flagMax () / _unit ) ; // %7 : maximal time
237  //
238  return _fmt.str() ;
239 }
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:177
constexpr double microsecond
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:173
constexpr double second
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:175
constexpr double nanosecond
constexpr double millisecond
The basic counter used for Monitoring purposes.
Definition: StatEntity.h:64
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
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
typthe chrono type
fmtthe format string
unitthe unit
Returns
the string representations
See also
boost::format
std::string ChronoEntity::outputUserTime ( ) const

print the chrono ;

std::string ChronoEntity::outputUserTime ( ) const

print the chrono ;

Definition at line 85 of file ChronoEntity.cpp.

86 {
87  return "Time User : " + format
88  ( uTotalTime () ,
89  uMinimalTime () ,
90  uMeanTime () ,
91  uRMSTime () ,
92  uMaximalTime () ,
93  nOfMeasurements() );
94 }
double uMinimalTime() const
minimal measurement for user time
Definition: ChronoEntity.h:195
double uTotalTime() const
total user time
Definition: ChronoEntity.h:226
double uRMSTime() const
r.m.s User Time
Definition: ChronoEntity.h:267
double uMeanTime() const
average User Time
Definition: ChronoEntity.h:252
std::string format(const double total, const double minimal, const double mean, const double rms, const double maximal, const unsigned long number) const
format
unsigned long nOfMeasurements() const
number of chrono measurements
Definition: ChronoEntity.h:191
double uMaximalTime() const
maximal measurement for user time
Definition: ChronoEntity.h:211
std::string ChronoEntity::outputUserTime ( const std::string &  fmt,
System::TimeType  unit 
) const
inline

print the chrono according the format and units

Parameters
fmtthe format string
unitthe unit
Returns
the string representations
See also
boost::format
std::string ChronoEntity::outputUserTime ( const std::string &  fmt,
System::TimeType  unit 
) const
inline

print the chrono according the format and units

Parameters
fmtthe format string
unitthe unit
Returns
the string representations
See also
boost::format

Definition at line 314 of file ChronoEntity.h.

316 {
317  return outputTime ( IChronoSvc::USER , fmt , unit ) ;
318 }
std::string outputTime(IChronoSvc::ChronoType typ, const std::string &fmt, System::TimeType unit) const
print the chrono according the format and units
IChronoSvc::ChronoStatus ChronoEntity::start ( )

start the current chrono

IChronoSvc::ChronoStatus ChronoEntity::start ( )

start the current chrono

Definition at line 47 of file ChronoEntity.cpp.

48 {
49  if ( IChronoSvc::RUNNING == m_status ) { return m_status ; }
50  //
51  // following lines could be platform dependent!
52  //
53  // Store in object the measured times
55 
57 
58  return m_status ;
59 }
GAUDI_API ProcessTime getProcessTime(long pid=-1)
Retrieve the process time data for a process.
Definition: Timing.cpp:178
IChronoSvc::ChronoStatus m_status
current status of this chrono object;
Definition: ChronoEntity.h:167
System::ProcessTime m_start
start stamp for current measurement of process times
Definition: ChronoEntity.h:171
IChronoSvc::ChronoStatus ChronoEntity::status ( ) const
inline

return the status of chrono

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

return the status of chrono

Definition at line 186 of file ChronoEntity.h.

186 { return m_status; }
IChronoSvc::ChronoStatus m_status
current status of this chrono object;
Definition: ChronoEntity.h:167
IChronoSvc::ChronoStatus ChronoEntity::stop ( )

stop the chrono

Definition at line 63 of file ChronoEntity.cpp.

64 {
65  if ( IChronoSvc::RUNNING != m_status ) { return m_status ; }
66 
67  // following lines could be platform dependent!
69 
70  // update the counters:
71 
75 
76  // set new status
77 
79 
80  return m_status ;
81 }
GAUDI_API ProcessTime getProcessTime(long pid=-1)
Retrieve the process time data for a process.
Definition: Timing.cpp:178
IChronoSvc::ChronoStatus m_status
current status of this chrono object;
Definition: ChronoEntity.h:167
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:177
TimeValueType kernelTime() const
Retrieve the kernel time in the requested unit.
Definition: Timing.h:146
TimeValueType userTime() const
Retrieve the user time in the requested unit.
Definition: Timing.h:150
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:173
System::ProcessTime m_start
start stamp for current measurement of process times
Definition: ChronoEntity.h:171
System::ProcessTime m_delta
delta process times
Definition: ChronoEntity.h:169
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:175
TimeValueType elapsedTime() const
Retrieve the elapsed time in the requested unit.
Definition: Timing.h:154
static const System::TimeType TimeUnit
internal unit used for the system time conversion (microseconds)
Definition: ChronoEntity.h:179
IChronoSvc::ChronoStatus ChronoEntity::stop ( )

stop the chrono

double ChronoEntity::totalTime ( ) const
inline

total time

Definition at line 241 of file ChronoEntity.h.

242 { return uTotalTime() + kTotalTime() ; }
double uTotalTime() const
total user time
Definition: ChronoEntity.h:226
double kTotalTime() const
total Kernel time
Definition: ChronoEntity.h:231
double ChronoEntity::totalTime ( ) const
inline

total time

double ChronoEntity::uMaximalTime ( ) const
inline

maximal measurement for user time

Definition at line 211 of file ChronoEntity.h.

211 { return m_user . flagMax () ; }
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:173
double ChronoEntity::uMaximalTime ( ) const
inline

maximal measurement for user time

double ChronoEntity::uMeanErrorTime ( ) const
inline

error in mean User time

double ChronoEntity::uMeanErrorTime ( ) const
inline

error in mean User time

Definition at line 282 of file ChronoEntity.h.

282 { return m_user . flagMeanErr () ; }
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:173
double ChronoEntity::uMeanTime ( ) const
inline

average User Time

double ChronoEntity::uMeanTime ( ) const
inline

average User Time

Definition at line 252 of file ChronoEntity.h.

252 { return m_user . flagMean () ; }
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:173
double ChronoEntity::uMinimalTime ( ) const
inline

minimal measurement for user time

Definition at line 195 of file ChronoEntity.h.

196 { return m_user . flagMin () ; }
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:173
double ChronoEntity::uMinimalTime ( ) const
inline

minimal measurement for user time

double ChronoEntity::uRMSTime ( ) const
inline

r.m.s User Time

Definition at line 267 of file ChronoEntity.h.

267 { return m_user . flagRMS () ; }
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:173
double ChronoEntity::uRMSTime ( ) const
inline

r.m.s User Time

double ChronoEntity::uTotalTime ( ) const
inline

total user time

Definition at line 226 of file ChronoEntity.h.

226 { return m_user . flag () ; }
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:173
double ChronoEntity::uTotalTime ( ) const
inline

total user time

Member Data Documentation

System::ProcessTime ChronoEntity::m_delta
private

delta process times

Definition at line 169 of file ChronoEntity.h.

StatEntity ChronoEntity::m_elapsed
private

the actual storage of "elapsed" time

Definition at line 177 of file ChronoEntity.h.

StatEntity ChronoEntity::m_kernel
private

the actual storage of "kernel" time

Definition at line 175 of file ChronoEntity.h.

System::ProcessTime ChronoEntity::m_start
private

start stamp for current measurement of process times

Definition at line 171 of file ChronoEntity.h.

IChronoSvc::ChronoStatus ChronoEntity::m_status = IChronoSvc::UNKNOWN
private

current status of this chrono object;

Definition at line 167 of file ChronoEntity.h.

StatEntity ChronoEntity::m_user
private

the actual storage of "user" time

Definition at line 173 of file ChronoEntity.h.

static const System::TimeType ChronoEntity::TimeUnit = System::microSec
staticprivate

internal unit used for the system time conversion (microseconds)

Definition at line 179 of file ChronoEntity.h.


The documentation for this class was generated from the following files: