| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
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]

## 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...
ChronoEntity & | operator+= (const ChronoEntity &entity)
| Compound assignment 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...

## 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...

## Friends
bool | operator< (ChronoEntity const &lhs, ChronoEntity const &rhs)
| comparison operator 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::ChronoEntity | ( |  | ) |
| default

default constructor

## Member Function Documentation

## ◆ delta()

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

return the last delta-time of type "type"

Definition at line 261 of file ChronoEntity.h.

261 {
262 const IChronoSvc::ChronoTime result = -1;
263 switch ( type ) {
264 case IChronoSvc::USER:
265 return m_delta.userTime<TimeUnit>();
266 case IChronoSvc::KERNEL:
267 return m_delta.kernelTime<TimeUnit>();
268 case IChronoSvc::ELAPSED:
269 return m_delta.elapsedTime<TimeUnit>();
270 default:
271 return result;
272 }
273 // cannot reach this point
274 }
System::ProcessTime::userTime
TimeValueType userTime() const
Retrieve the user time in the requested unit.
Definition: Timing.h:164
System::ProcessTime::elapsedTime
TimeValueType elapsedTime() const
Retrieve the elapsed time in the requested unit.
Definition: Timing.h:170
IChronoSvc::KERNEL
Definition: IChronoSvc.h:46
System::ProcessTime::kernelTime
TimeValueType kernelTime() const
Retrieve the kernel time in the requested unit.
Definition: Timing.h:158
IChronoSvc::USER
Definition: IChronoSvc.h:46
ChronoEntity::m_delta
System::ProcessTime m_delta
delta process times
Definition: ChronoEntity.h:161
gaudirun.type
type
Definition: gaudirun.py:142
IChronoSvc::ELAPSED
Definition: IChronoSvc.h:46
IChronoSvc::ChronoTime
double ChronoTime
Type of the delta-time.
Definition: IChronoSvc.h:39
ChronoEntity::TimeUnit
static const System::TimeType TimeUnit
internal unit used for the system time conversion (microseconds)
Definition: ChronoEntity.h:171

## ◆ eMaximalTime()

double ChronoEntity::eMaximalTime | ( |  | ) | const
| inline

maximal measurement for elapsed time

Definition at line 205 of file ChronoEntity.h.

205 { return m_elapsed.flagMax(); }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:169

## ◆ eMeanErrorTime()

double ChronoEntity::eMeanErrorTime | ( |  | ) | const
| inline

error in mean Elapsed time

Definition at line 257 of file ChronoEntity.h.

257 { return m_elapsed.flagMeanErr(); }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:169

## ◆ eMeanTime()

double ChronoEntity::eMeanTime | ( |  | ) | const
| inline

average Elapsed Time

Definition at line 233 of file ChronoEntity.h.

233 { return m_elapsed.flagMean(); }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:169

## ◆ eMinimalTime()

double ChronoEntity::eMinimalTime | ( |  | ) | const
| inline

minimal measurement for elapsed time

Definition at line 193 of file ChronoEntity.h.

193 { return m_elapsed.flagMin(); }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:169

## ◆ eRMSTime()

double ChronoEntity::eRMSTime | ( |  | ) | const
| inline

r.m.s Elapsed Time

Definition at line 245 of file ChronoEntity.h.

245 { return m_elapsed.flagRMS(); }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:169

## ◆ eTotalTime()

double ChronoEntity::eTotalTime | ( |  | ) | const
| inline

total Elapsed time

Definition at line 217 of file ChronoEntity.h.

217 { return m_elapsed.flag(); }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:169

## ◆ 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

Todo:
  : cache the format

Todo:
  : cache the format

Definition at line 102 of file ChronoEntity.cpp.

103 {
104
106 boost::format fmt( "Tot=%2$5.3g%1$s %4$43s #=%3$3lu" );
107
108 static const auto tbl = {std::make_tuple( 500, microsecond, " [us]" ), std::make_tuple( 500, millisecond, " [ms]" ),
109 std::make_tuple( 500, second, " [s]" ), std::make_tuple( 500, minute, "[min]" ),
110 std::make_tuple( 500, hour, " [h]" ), std::make_tuple( 10, day, "[day]" ),
111 std::make_tuple( 5, week, " [w]" ), std::make_tuple( 20, month, "[mon]" ),
112 std::make_tuple( -1, year, " [y]" )};
113
114 auto i = std::find_if(
115 std::begin( tbl ), std::prev( std::end( tbl ) ),
116 [&]( const std::tuple<int, double, const char*>& i ) { return total < std::get<0>( i ) * std::get<1>( i ); } );
117 long double unit = std::get<1>( *i );
118 fmt % std::get<2>( *i ) % (double)( total / unit ) % number;
119
120 if ( number > 1 ) {
122 boost::format fmt1( "Ave/Min/Max=%2$5.3g(+-%3$5.3g)/%4$5.3g/%5$5.3g%1$s" );
123 i = std::find_if(
124 std::begin( tbl ), std::prev( std::end( tbl ) ),
125 [&]( const std::tuple<int, double, const char*>& i ) { return total < std::get<0>( i ) * std::get<1>( i ); } );
126 unit = std::get<1>( *i );
127 fmt1 % std::get<2>( *i ) % (double)( mean / unit ) % (double)( rms / unit ) % (double)( minimal / unit ) %
128 (double)( maximal / unit );
129 fmt % fmt1.str();
130 } else {
131 fmt % "";
132 }
133
134 return fmt.str();
135 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
Gaudi::Units::microsecond
constexpr double microsecond
Definition: SystemOfUnits.h:123
std::make_tuple
T make_tuple(T... args)
std::end
T end(T... args)
std::prev
T prev(T... args)
Gaudi::Units::second
constexpr double second
Definition: SystemOfUnits.h:121
GaudiPython.HistoUtils.mean
mean
Definition: HistoUtils.py:875
std::tuple
std::find_if
T find_if(T... args)
std::begin
T begin(T... args)
Gaudi::Units::millisecond
constexpr double millisecond
Definition: SystemOfUnits.h:122
GaudiPython.HistoUtils.rms
rms
Definition: HistoUtils.py:879

## ◆ kMaximalTime()

double ChronoEntity::kMaximalTime | ( |  | ) | const
| inline

maximal measurement for kernel time

Definition at line 201 of file ChronoEntity.h.

201 { return m_kernel.flagMax(); }
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:167

## ◆ kMeanErrorTime()

double ChronoEntity::kMeanErrorTime | ( |  | ) | const
| inline

error in mean Kernel time

Definition at line 249 of file ChronoEntity.h.

249 { return m_kernel.flagMeanErr(); }
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:167

## ◆ kMeanTime()

double ChronoEntity::kMeanTime | ( |  | ) | const
| inline

average Kernel Time

Definition at line 225 of file ChronoEntity.h.

225 { return m_kernel.flagMean(); }
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:167

## ◆ kMinimalTime()

double ChronoEntity::kMinimalTime | ( |  | ) | const
| inline

minimal measurement for kernel time

Definition at line 189 of file ChronoEntity.h.

189 { return m_kernel.flagMin(); }
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:167

## ◆ kRMSTime()

double ChronoEntity::kRMSTime | ( |  | ) | const
| inline

r.m.s Kernel Time

Definition at line 237 of file ChronoEntity.h.

237 { return m_kernel.flagRMS(); }
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:167

## ◆ kTotalTime()

double ChronoEntity::kTotalTime | ( |  | ) | const
| inline

total Kernel time

Definition at line 213 of file ChronoEntity.h.

213 { return m_kernel.flag(); }
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:167

## ◆ nOfMeasurements()

unsigned long ChronoEntity::nOfMeasurements | ( |  | ) | const
| inline

number of chrono measurements

Definition at line 181 of file ChronoEntity.h.

181 { return m_user.nEntries(); }
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:165

## ◆ operator+=()

ChronoEntity & ChronoEntity::operator+= | ( | const ChronoEntity & | entity | ) |

Compound assignment operator.

Definition at line 139 of file ChronoEntity.cpp.

139 {
140 // System::ProcessTime type
141 m_delta += e.m_delta;
142
143 // Summing, massaging here does not make too much sense.
144 // This is done only for final reductions
145 // Keep by convention the original one.
146 // m_start += e.m_start;
147
148 // Tymevaluetypes type
149 m_user += e.m_user;
150 m_kernel += e.m_kernel;
151 m_elapsed += e.m_elapsed;
152
153 return *this;
154 }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:169
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:165
ChronoEntity::m_delta
System::ProcessTime m_delta
delta process times
Definition: ChronoEntity.h:161
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:167

## ◆ outputElapsedTime() [1/2]

std::string ChronoEntity::outputElapsedTime | ( |  | ) | const

print the chrono ;

Definition at line 95 of file ChronoEntity.cpp.

95 {
96 return "TimeElapsed: " +
97 format( eTotalTime(), eMinimalTime(), eMeanTime(), eRMSTime(), eMaximalTime(), nOfMeasurements() );
98 }
ChronoEntity::eRMSTime
double eRMSTime() const
r.m.s Elapsed Time
Definition: ChronoEntity.h:245
ChronoEntity::format
std::string format(const double total, const double minimal, const double mean, const double rms, const double maximal, const unsigned long number) const
format
Definition: ChronoEntity.cpp:102
ChronoEntity::eMaximalTime
double eMaximalTime() const
maximal measurement for elapsed time
Definition: ChronoEntity.h:205
ChronoEntity::nOfMeasurements
unsigned long nOfMeasurements() const
number of chrono measurements
Definition: ChronoEntity.h:181
ChronoEntity::eMinimalTime
double eMinimalTime() const
minimal measurement for elapsed time
Definition: ChronoEntity.h:193
ChronoEntity::eTotalTime
double eTotalTime() const
total Elapsed time
Definition: ChronoEntity.h:217
ChronoEntity::eMeanTime
double eMeanTime() const
average Elapsed Time
Definition: ChronoEntity.h:233

## ◆ outputElapsedTime() [2/2]

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 305 of file ChronoEntity.h.

305 {
306 return outputTime( IChronoSvc::ELAPSED, fmt, unit );
307 }
ChronoEntity::outputTime
std::string outputTime(IChronoSvc::ChronoType typ, const std::string &fmt, System::TimeType unit) const
print the chrono according the format and units
Definition: ChronoEntity.cpp:165
IChronoSvc::ELAPSED
Definition: IChronoSvc.h:46

## ◆ outputSystemTime() [1/2]

std::string ChronoEntity::outputSystemTime | ( |  | ) | const

print the chrono ;

Definition at line 89 of file ChronoEntity.cpp.

89 {
90 return "Time System : " +
91 format( kTotalTime(), kMinimalTime(), kMeanTime(), kRMSTime(), kMaximalTime(), nOfMeasurements() );
92 }
ChronoEntity::format
std::string format(const double total, const double minimal, const double mean, const double rms, const double maximal, const unsigned long number) const
format
Definition: ChronoEntity.cpp:102
ChronoEntity::kRMSTime
double kRMSTime() const
r.m.s Kernel Time
Definition: ChronoEntity.h:237
ChronoEntity::nOfMeasurements
unsigned long nOfMeasurements() const
number of chrono measurements
Definition: ChronoEntity.h:181
ChronoEntity::kMeanTime
double kMeanTime() const
average Kernel Time
Definition: ChronoEntity.h:225
ChronoEntity::kTotalTime
double kTotalTime() const
total Kernel time
Definition: ChronoEntity.h:213
ChronoEntity::kMinimalTime
double kMinimalTime() const
minimal measurement for kernel time
Definition: ChronoEntity.h:189
ChronoEntity::kMaximalTime
double kMaximalTime() const
maximal measurement for kernel time
Definition: ChronoEntity.h:201

## ◆ outputSystemTime() [2/2]

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 294 of file ChronoEntity.h.

294 {
295 return outputTime( IChronoSvc::KERNEL, fmt, unit );
296 }
ChronoEntity::outputTime
std::string outputTime(IChronoSvc::ChronoType typ, const std::string &fmt, System::TimeType unit) const
print the chrono according the format and units
Definition: ChronoEntity.cpp:165
IChronoSvc::KERNEL
Definition: IChronoSvc.h:46

## ◆ outputTime()

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

Definition at line 165 of file ChronoEntity.cpp.

166 {
167 boost::format _fmt( fmt );
168 // allow various number of arguments
169 using namespace boost::io;
170 _fmt.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
171 //
172 double _unit = microsecond;
173 switch ( unit ) {
174 case System::Year:
175 _unit = year;
176 break;
177 case System::Month:
178 _unit = month;
179 break;
180 case System::Day:
181 _unit = day;
182 break;
183 case System::Hour:
184 _unit = hour;
185 break;
186 case System::Min:
187 _unit = minute;
188 break;
189 case System::Sec:
190 _unit = second;
191 break;
192 case System::milliSec:
193 _unit = millisecond;
194 break;
195 case System::microSec:
196 _unit = microsecond;
197 break;
198 case System::nanoSec:
199 _unit = nanosecond;
200 break;
201 default:
202 _unit = microsecond;
203 break;
204 }
205 //
206 const StatEntity* stat = &m_user;
207 switch ( typ ) {
208 case IChronoSvc::USER:
209 stat = &m_user;
210 break;
211 case IChronoSvc::KERNEL:
212 stat = &m_kernel;
213 break;
214 case IChronoSvc::ELAPSED:
215 stat = &m_elapsed;
216 break;
217 default:
218 stat = &m_user;
219 break;
220 }
221 //
222 _fmt % ( stat->nEntries() ) // %1 : #entries
223 % ( stat->flag() / _unit ) // %2 : total time
224 % ( stat->flagMean() / _unit ) // %3 : mean time
225 % ( stat->flagRMS() / _unit ) // %4 : RMS time
226 % ( stat->flagMeanErr() / _unit ) // %5 : error in mean time
227 % ( stat->flagMin() / _unit ) // %6 : minimal time
228 % ( stat->flagMax() / _unit ); // %7 : maximal time
229 //
230 return _fmt.str();
231 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:169
System::Min
Definition: Timing.h:57
Gaudi::Units::microsecond
constexpr double microsecond
Definition: SystemOfUnits.h:123
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:165
IChronoSvc::KERNEL
Definition: IChronoSvc.h:46
System::Hour
Definition: Timing.h:57
System::milliSec
Definition: Timing.h:57
System::Sec
Definition: Timing.h:57
Gaudi::Units::second
constexpr double second
Definition: SystemOfUnits.h:121
IChronoSvc::USER
Definition: IChronoSvc.h:46
System::microSec
Definition: Timing.h:57
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:167
IChronoSvc::ELAPSED
Definition: IChronoSvc.h:46
System::Month
Definition: Timing.h:57
System::nanoSec
Definition: Timing.h:57
Gaudi::Units::nanosecond
constexpr double nanosecond
Definition: SystemOfUnits.h:120
Gaudi::Units::millisecond
constexpr double millisecond
Definition: SystemOfUnits.h:122
System::Year
Definition: Timing.h:57
System::Day
Definition: Timing.h:57

## ◆ outputUserTime() [1/2]

std::string ChronoEntity::outputUserTime | ( |  | ) | const

print the chrono ;

Definition at line 82 of file ChronoEntity.cpp.

82 {
83 return "Time User : " +
84 format( uTotalTime(), uMinimalTime(), uMeanTime(), uRMSTime(), uMaximalTime(), nOfMeasurements() );
85 }
ChronoEntity::uMinimalTime
double uMinimalTime() const
minimal measurement for user time
Definition: ChronoEntity.h:185
ChronoEntity::format
std::string format(const double total, const double minimal, const double mean, const double rms, const double maximal, const unsigned long number) const
format
Definition: ChronoEntity.cpp:102
ChronoEntity::uTotalTime
double uTotalTime() const
total user time
Definition: ChronoEntity.h:209
ChronoEntity::nOfMeasurements
unsigned long nOfMeasurements() const
number of chrono measurements
Definition: ChronoEntity.h:181
ChronoEntity::uMeanTime
double uMeanTime() const
average User Time
Definition: ChronoEntity.h:229
ChronoEntity::uMaximalTime
double uMaximalTime() const
maximal measurement for user time
Definition: ChronoEntity.h:197
ChronoEntity::uRMSTime
double uRMSTime() const
r.m.s User Time
Definition: ChronoEntity.h:241

## ◆ outputUserTime() [2/2]

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 283 of file ChronoEntity.h.

283 {
284 return outputTime( IChronoSvc::USER, fmt, unit );
285 }
ChronoEntity::outputTime
std::string outputTime(IChronoSvc::ChronoType typ, const std::string &fmt, System::TimeType unit) const
print the chrono according the format and units
Definition: ChronoEntity.cpp:165
IChronoSvc::USER
Definition: IChronoSvc.h:46

## ◆ start()

IChronoSvc::ChronoStatus ChronoEntity::start | ( |  | ) |

start the current chrono

Definition at line 46 of file ChronoEntity.cpp.

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

## ◆ status()

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

return the status of chrono

Definition at line 177 of file ChronoEntity.h.

177 { return m_status; }
ChronoEntity::m_status
IChronoSvc::ChronoStatus m_status
current status of this chrono object;
Definition: ChronoEntity.h:159

## ◆ stop()

IChronoSvc::ChronoStatus ChronoEntity::stop | ( |  | ) |

stop the chrono

Definition at line 61 of file ChronoEntity.cpp.

61 {
62 if ( IChronoSvc::RUNNING != m_status ) { return m_status; }
63
64 // following lines could be platform dependent!
65 m_delta = System::getProcessTime() - m_start;
66
67 // update the counters:
68
69 m_user += m_delta.userTime<TimeUnit>();
70 m_kernel += m_delta.kernelTime<TimeUnit>();
71 m_elapsed += m_delta.elapsedTime<TimeUnit>();
72
73 // set new status
74
75 m_status = IChronoSvc::STOPPED;
76
77 return m_status;
78 }
System::ProcessTime::userTime
TimeValueType userTime() const
Retrieve the user time in the requested unit.
Definition: Timing.h:164
ChronoEntity::m_status
IChronoSvc::ChronoStatus m_status
current status of this chrono object;
Definition: ChronoEntity.h:159
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:169
System::ProcessTime::elapsedTime
TimeValueType elapsedTime() const
Retrieve the elapsed time in the requested unit.
Definition: Timing.h:170
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:165
IChronoSvc::STOPPED
Definition: IChronoSvc.h:44
System::ProcessTime::kernelTime
TimeValueType kernelTime() const
Retrieve the kernel time in the requested unit.
Definition: Timing.h:158
ChronoEntity::m_start
System::ProcessTime m_start
start stamp for current measurement of process times
Definition: ChronoEntity.h:163
ChronoEntity::m_delta
System::ProcessTime m_delta
delta process times
Definition: ChronoEntity.h:161
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:167
System::getProcessTime
GAUDI_API ProcessTime getProcessTime(long pid=-1)
Retrieve the process time data for a process.
Definition: Timing.cpp:196
ChronoEntity::TimeUnit
static const System::TimeType TimeUnit
internal unit used for the system time conversion (microseconds)
Definition: ChronoEntity.h:171
IChronoSvc::RUNNING
Definition: IChronoSvc.h:44

## ◆ totalTime()

double ChronoEntity::totalTime | ( |  | ) | const
| inline

total time

Definition at line 221 of file ChronoEntity.h.

221 { return uTotalTime() + kTotalTime(); }
ChronoEntity::uTotalTime
double uTotalTime() const
total user time
Definition: ChronoEntity.h:209
ChronoEntity::kTotalTime
double kTotalTime() const
total Kernel time
Definition: ChronoEntity.h:213

## ◆ uMaximalTime()

double ChronoEntity::uMaximalTime | ( |  | ) | const
| inline

maximal measurement for user time

Definition at line 197 of file ChronoEntity.h.

197 { return m_user.flagMax(); }
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:165

## ◆ uMeanErrorTime()

double ChronoEntity::uMeanErrorTime | ( |  | ) | const
| inline

error in mean User time

Definition at line 253 of file ChronoEntity.h.

253 { return m_user.flagMeanErr(); }
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:165

## ◆ uMeanTime()

double ChronoEntity::uMeanTime | ( |  | ) | const
| inline

average User Time

Definition at line 229 of file ChronoEntity.h.

229 { return m_user.flagMean(); }
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:165

## ◆ uMinimalTime()

double ChronoEntity::uMinimalTime | ( |  | ) | const
| inline

minimal measurement for user time

Definition at line 185 of file ChronoEntity.h.

185 { return m_user.flagMin(); }
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:165

## ◆ uRMSTime()

double ChronoEntity::uRMSTime | ( |  | ) | const
| inline

r.m.s User Time

Definition at line 241 of file ChronoEntity.h.

241 { return m_user.flagRMS(); }
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:165

## ◆ uTotalTime()

double ChronoEntity::uTotalTime | ( |  | ) | const
| inline

total user time

Definition at line 209 of file ChronoEntity.h.

209 { return m_user.flag(); }
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:165

## Friends And Related Function Documentation

## ◆ operator<

bool operator< | ( | ChronoEntity const & | lhs,
|  | ChronoEntity const & | rhs
| ) |  |
| friend

comparison operator

Definition at line 89 of file ChronoEntity.h.

89 {
90 return std::make_tuple( lhs.totalTime(), lhs.m_user, lhs.m_kernel, lhs.m_elapsed ) <
91 std::make_tuple( rhs.totalTime(), rhs.m_user, rhs.m_kernel, rhs.m_elapsed );
92 }
std::make_tuple
T make_tuple(T... args)

## Member Data Documentation

## ◆ m_delta

System::ProcessTime ChronoEntity::m_delta
| private

delta process times

Definition at line 161 of file ChronoEntity.h.

## ◆ m_elapsed

StatEntity ChronoEntity::m_elapsed
| private

the actual storage of "elapsed" time

Definition at line 169 of file ChronoEntity.h.

## ◆ m_kernel

StatEntity ChronoEntity::m_kernel
| private

the actual storage of "kernel" time

Definition at line 167 of file ChronoEntity.h.

## ◆ m_start

System::ProcessTime ChronoEntity::m_start
| private

start stamp for current measurement of process times

Definition at line 163 of file ChronoEntity.h.

## ◆ m_status

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

current status of this chrono object;

Definition at line 159 of file ChronoEntity.h.

## ◆ m_user

StatEntity ChronoEntity::m_user
| private

the actual storage of "user" time

Definition at line 165 of file ChronoEntity.h.

## ◆ TimeUnit

const System::TimeType ChronoEntity::TimeUnit = System::microSec
| static private

internal unit used for the system time conversion (microseconds)

Definition at line 171 of file ChronoEntity.h.

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

- GaudiKernel/GaudiKernel/ChronoEntity.h
- GaudiKernel/src/Lib/ChronoEntity.cpp