| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | 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...
bool | operator< (const ChronoEntity &entity) const
| comparison operator 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...

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

## Member Function Documentation

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

return the last delta-time of type "type"

Definition at line 295 of file ChronoEntity.h.

296 {
297 const IChronoSvc::ChronoTime result = -1 ;
298 switch ( type )
299 {
300 case IChronoSvc::USER : return m_delta.userTime<TimeUnit>();
301 case IChronoSvc::KERNEL : return m_delta.kernelTime<TimeUnit>();
302 case IChronoSvc::ELAPSED : return m_delta.elapsedTime<TimeUnit>();
303 default : return result;
304 }
305 // cannot reach this point
306 }
System::ProcessTime::kernelTime
TimeValueType kernelTime() const
Retrieve the kernel time in the requested unit.
Definition: Timing.h:159
System::ProcessTime::userTime
TimeValueType userTime() const
Retrieve the user time in the requested unit.
Definition: Timing.h:163
IChronoSvc::KERNEL
Definition: IChronoSvc.h:56
IChronoSvc::USER
Definition: IChronoSvc.h:55
ChronoEntity::m_delta
System::ProcessTime m_delta
delta process times
Definition: ChronoEntity.h:172
gaudirun.type
type
Definition: gaudirun.py:125
IChronoSvc::ELAPSED
Definition: IChronoSvc.h:57
IChronoSvc::ChronoTime
double ChronoTime
Type of the delta-time.
Definition: IChronoSvc.h:41
System::ProcessTime::elapsedTime
TimeValueType elapsedTime() const
Retrieve the elapsed time in the requested unit.
Definition: Timing.h:167
ChronoEntity::TimeUnit
static const System::TimeType TimeUnit
internal unit used for the system time conversion (microseconds)
Definition: ChronoEntity.h:182

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

maximal measurement for elapsed time

Definition at line 224 of file ChronoEntity.h.

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

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

error in mean Elapsed time

Definition at line 290 of file ChronoEntity.h.

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

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

average Elapsed Time

Definition at line 260 of file ChronoEntity.h.

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

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

minimal measurement for elapsed time

Definition at line 209 of file ChronoEntity.h.

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

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

r.m.s Elapsed Time

Definition at line 275 of file ChronoEntity.h.

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

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

total Elapsed time

Definition at line 239 of file ChronoEntity.h.

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

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 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
Gaudi::Units::microsecond
constexpr double microsecond
Definition: SystemOfUnits.h:124
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:122
GaudiPython.HistoUtils.mean
mean
Definition: HistoUtils.py:737
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:123
GaudiPython.HistoUtils.rms
rms
Definition: HistoUtils.py:739

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

maximal measurement for kernel time

Definition at line 219 of file ChronoEntity.h.

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

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

error in mean Kernel time

Definition at line 280 of file ChronoEntity.h.

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

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

average Kernel Time

Definition at line 250 of file ChronoEntity.h.

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

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

minimal measurement for kernel time

Definition at line 204 of file ChronoEntity.h.

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

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

r.m.s Kernel Time

Definition at line 265 of file ChronoEntity.h.

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

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

total Kernel time

Definition at line 234 of file ChronoEntity.h.

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

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

number of chrono measurements

Definition at line 194 of file ChronoEntity.h.

194 { return m_user . nEntries() ; }
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:176
GaudiPython.HistoUtils.nEntries
nEntries
Definition: HistoUtils.py:756

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

Compound assignment operator.

Definition at line 189 of file ChronoEntity.cpp.

190 {
191 // System::ProcessTime type
192 m_delta += e.m_delta;
193
194 // Summing, massaging here does not make too much sense.
195 // This is done only for final reductions
196 // Keep by convention the original one.
197 // m_start += e.m_start;
198
199 // Tymevaluetypes type
200 m_user += e.m_user;
201 m_kernel += e.m_kernel;
202 m_elapsed += e.m_elapsed;
203
204 return *this;
205 }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:180
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:176
ChronoEntity::m_delta
System::ProcessTime m_delta
delta process times
Definition: ChronoEntity.h:172
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:178

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 }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:180
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:176
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:178
ChronoEntity::totalTime
double totalTime() const
total time
Definition: ChronoEntity.h:244

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 }
ChronoEntity::eMinimalTime
double eMinimalTime() const
minimal measurement for elapsed time
Definition: ChronoEntity.h:209
ChronoEntity::eMeanTime
double eMeanTime() const
average Elapsed Time
Definition: ChronoEntity.h:260
ChronoEntity::eRMSTime
double eRMSTime() const
r.m.s Elapsed Time
Definition: ChronoEntity.h:275
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:124
ChronoEntity::eMaximalTime
double eMaximalTime() const
maximal measurement for elapsed time
Definition: ChronoEntity.h:224
ChronoEntity::nOfMeasurements
unsigned long nOfMeasurements() const
number of chrono measurements
Definition: ChronoEntity.h:194
ChronoEntity::eTotalTime
double eTotalTime() const
total Elapsed time
Definition: ChronoEntity.h:239

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

349 {
350 return outputTime ( IChronoSvc::ELAPSED , fmt , unit ) ;
351 }
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:218
IChronoSvc::ELAPSED
Definition: IChronoSvc.h:57

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 }
ChronoEntity::kMaximalTime
double kMaximalTime() const
maximal measurement for kernel time
Definition: ChronoEntity.h:219
ChronoEntity::kTotalTime
double kTotalTime() const
total Kernel time
Definition: ChronoEntity.h:234
ChronoEntity::kMinimalTime
double kMinimalTime() const
minimal measurement for kernel time
Definition: ChronoEntity.h:204
ChronoEntity::kRMSTime
double kRMSTime() const
r.m.s Kernel Time
Definition: ChronoEntity.h:265
ChronoEntity::kMeanTime
double kMeanTime() const
average Kernel Time
Definition: ChronoEntity.h:250
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:124
ChronoEntity::nOfMeasurements
unsigned long nOfMeasurements() const
number of chrono measurements
Definition: ChronoEntity.h:194

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

334 {
335 return outputTime ( IChronoSvc::KERNEL , fmt , unit ) ;
336 }
IChronoSvc::KERNEL
Definition: IChronoSvc.h:56
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:218

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 218 of file ChronoEntity.cpp.

221 {
222 boost::format _fmt ( fmt ) ;
223 // allow various number of arguments
224 using namespace boost::io ;
225 _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
226 //
227 double _unit = microsecond ;
228 switch ( unit )
229 {
230 case System::Year : _unit = year ; break ;
231 case System::Month : _unit = month ; break ;
232 case System::Day : _unit = day ; break ;
233 case System::Hour : _unit = hour ; break ;
234 case System::Min : _unit = minute ; break ;
235 case System::Sec : _unit = second ; break ;
236 case System::milliSec : _unit = millisecond ; break ;
237 case System::microSec : _unit = microsecond ; break ;
238 case System::nanoSec : _unit = nanosecond ; break ;
239 default : _unit = microsecond ; break ;
240 }
241 //
242 const StatEntity* stat = &m_user;
243 switch ( typ )
244 {
245 case IChronoSvc::USER : stat = &m_user ; break ;
246 case IChronoSvc::KERNEL : stat = &m_kernel ; break ;
247 case IChronoSvc::ELAPSED : stat = &m_elapsed ; break ;
248 default : stat = &m_user ; break ;
249 }
250 //
251 _fmt
252 % ( stat -> nEntries () ) // %1 : #entries
253 % ( stat -> flag () / _unit ) // %2 : total time
254 % ( stat -> flagMean () / _unit ) // %3 : mean time
255 % ( stat -> flagRMS () / _unit ) // %4 : RMS time
256 % ( stat -> flagMeanErr () / _unit ) // %5 : error in mean time
257 % ( stat -> flagMin () / _unit ) // %6 : minimal time
258 % ( stat -> flagMax () / _unit ) ; // %7 : maximal time
259 //
260 return _fmt.str() ;
261 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:180
System::Min
Definition: Timing.h:57
Gaudi::Units::microsecond
constexpr double microsecond
Definition: SystemOfUnits.h:124
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:176
IChronoSvc::KERNEL
Definition: IChronoSvc.h:56
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:122
IChronoSvc::USER
Definition: IChronoSvc.h:55
System::microSec
Definition: Timing.h:57
GaudiPython.HistoUtils.nEntries
nEntries
Definition: HistoUtils.py:756
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:178
IChronoSvc::ELAPSED
Definition: IChronoSvc.h:57
System::Month
Definition: Timing.h:57
System::nanoSec
Definition: Timing.h:57
Gaudi::Units::nanosecond
constexpr double nanosecond
Definition: SystemOfUnits.h:121
Gaudi::Units::millisecond
constexpr double millisecond
Definition: SystemOfUnits.h:123
System::Year
Definition: Timing.h:57
StatEntity
The basic counter used for Monitoring purposes.
Definition: StatEntity.h:65
System::Day
Definition: Timing.h:57

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 }
ChronoEntity::uMinimalTime
double uMinimalTime() const
minimal measurement for user time
Definition: ChronoEntity.h:198
ChronoEntity::uTotalTime
double uTotalTime() const
total user time
Definition: ChronoEntity.h:229
ChronoEntity::uRMSTime
double uRMSTime() const
r.m.s User Time
Definition: ChronoEntity.h:270
ChronoEntity::uMeanTime
double uMeanTime() const
average User Time
Definition: ChronoEntity.h:255
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:124
ChronoEntity::nOfMeasurements
unsigned long nOfMeasurements() const
number of chrono measurements
Definition: ChronoEntity.h:194
ChronoEntity::uMaximalTime
double uMaximalTime() const
maximal measurement for user time
Definition: ChronoEntity.h:214

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

319 {
320 return outputTime ( IChronoSvc::USER , fmt , unit ) ;
321 }
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:218
IChronoSvc::USER
Definition: IChronoSvc.h:55

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
54 m_start = System::getProcessTime();
55
56 m_status = IChronoSvc::RUNNING;
57
58 return m_status ;
59 }
ChronoEntity::m_status
IChronoSvc::ChronoStatus m_status
current status of this chrono object;
Definition: ChronoEntity.h:170
ChronoEntity::m_start
System::ProcessTime m_start
start stamp for current measurement of process times
Definition: ChronoEntity.h:174
System::getProcessTime
GAUDI_API ProcessTime getProcessTime(long pid=-1)
Retrieve the process time data for a process.
Definition: Timing.cpp:177
IChronoSvc::RUNNING
Definition: IChronoSvc.h:49

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

return the status of chrono

Definition at line 189 of file ChronoEntity.h.

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

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!
68 m_delta = System::getProcessTime() - m_start;
69
70 // update the counters:
71
72 m_user += m_delta.userTime<TimeUnit>();
73 m_kernel += m_delta.kernelTime<TimeUnit>();
74 m_elapsed += m_delta.elapsedTime<TimeUnit>();
75
76 // set new status
77
78 m_status = IChronoSvc::STOPPED;
79
80 return m_status ;
81 }
ChronoEntity::m_status
IChronoSvc::ChronoStatus m_status
current status of this chrono object;
Definition: ChronoEntity.h:170
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:180
System::ProcessTime::kernelTime
TimeValueType kernelTime() const
Retrieve the kernel time in the requested unit.
Definition: Timing.h:159
System::ProcessTime::userTime
TimeValueType userTime() const
Retrieve the user time in the requested unit.
Definition: Timing.h:163
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:176
IChronoSvc::STOPPED
Definition: IChronoSvc.h:50
ChronoEntity::m_start
System::ProcessTime m_start
start stamp for current measurement of process times
Definition: ChronoEntity.h:174
ChronoEntity::m_delta
System::ProcessTime m_delta
delta process times
Definition: ChronoEntity.h:172
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:178
System::ProcessTime::elapsedTime
TimeValueType elapsedTime() const
Retrieve the elapsed time in the requested unit.
Definition: Timing.h:167
System::getProcessTime
GAUDI_API ProcessTime getProcessTime(long pid=-1)
Retrieve the process time data for a process.
Definition: Timing.cpp:177
ChronoEntity::TimeUnit
static const System::TimeType TimeUnit
internal unit used for the system time conversion (microseconds)
Definition: ChronoEntity.h:182
IChronoSvc::RUNNING
Definition: IChronoSvc.h:49

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

total time

Definition at line 244 of file ChronoEntity.h.

245 { return uTotalTime() + kTotalTime() ; }
ChronoEntity::uTotalTime
double uTotalTime() const
total user time
Definition: ChronoEntity.h:229
ChronoEntity::kTotalTime
double kTotalTime() const
total Kernel time
Definition: ChronoEntity.h:234

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

maximal measurement for user time

Definition at line 214 of file ChronoEntity.h.

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

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

error in mean User time

Definition at line 285 of file ChronoEntity.h.

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

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

average User Time

Definition at line 255 of file ChronoEntity.h.

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

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

minimal measurement for user time

Definition at line 198 of file ChronoEntity.h.

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

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

r.m.s User Time

Definition at line 270 of file ChronoEntity.h.

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

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

total user time

Definition at line 229 of file ChronoEntity.h.

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

## Member Data Documentation

System::ProcessTime ChronoEntity::m_delta
| private

delta process times

Definition at line 172 of file ChronoEntity.h.

StatEntity ChronoEntity::m_elapsed
| private

the actual storage of "elapsed" time

Definition at line 180 of file ChronoEntity.h.

StatEntity ChronoEntity::m_kernel
| private

the actual storage of "kernel" time

Definition at line 178 of file ChronoEntity.h.

System::ProcessTime ChronoEntity::m_start
| private

start stamp for current measurement of process times

Definition at line 174 of file ChronoEntity.h.

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

current status of this chrono object;

Definition at line 170 of file ChronoEntity.h.

StatEntity ChronoEntity::m_user
| private

the actual storage of "user" time

Definition at line 176 of file ChronoEntity.h.

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

internal unit used for the system time conversion (microseconds)

Definition at line 182 of file ChronoEntity.h.

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

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