| The Gaudi Framework v29r1 (5cd95fa2)

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

260 {
261 const IChronoSvc::ChronoTime result = -1;
262 switch ( type ) {
263 case IChronoSvc::USER:
264 return m_delta.userTime<TimeUnit>();
265 case IChronoSvc::KERNEL:
266 return m_delta.kernelTime<TimeUnit>();
267 case IChronoSvc::ELAPSED:
268 return m_delta.elapsedTime<TimeUnit>();
269 default:
270 return result;
271 }
272 // cannot reach this point
273 }
System::ProcessTime::kernelTime
TimeValueType kernelTime() const
Retrieve the kernel time in the requested unit.
Definition: Timing.h:160
System::ProcessTime::userTime
TimeValueType userTime() const
Retrieve the user time in the requested unit.
Definition: Timing.h:167
IChronoSvc::KERNEL
Definition: IChronoSvc.h:48
IChronoSvc::USER
Definition: IChronoSvc.h:48
ChronoEntity::m_delta
System::ProcessTime m_delta
delta process times
Definition: ChronoEntity.h:159
gaudirun.type
type
Definition: gaudirun.py:133
IChronoSvc::ELAPSED
Definition: IChronoSvc.h:48
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:174
ChronoEntity::TimeUnit
static const System::TimeType TimeUnit
internal unit used for the system time conversion (microseconds)
Definition: ChronoEntity.h:169

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

maximal measurement for elapsed time

Definition at line 203 of file ChronoEntity.h.

203 { return m_elapsed.flagMax(); }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:167
StatEntity::flagMax
double flagMax() const
maximal flag
Definition: StatEntity.h:408

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

error in mean Elapsed time

Definition at line 255 of file ChronoEntity.h.

255 { return m_elapsed.flagMeanErr(); }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:167
StatEntity::flagMeanErr
double flagMeanErr() const
error in mean value of flag
Definition: StatEntity.h:404

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

average Elapsed Time

Definition at line 231 of file ChronoEntity.h.

231 { return m_elapsed.flagMean(); }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:167
StatEntity::flagMean
double flagMean() const
mean value of flag
Definition: StatEntity.h:400

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

minimal measurement for elapsed time

Definition at line 191 of file ChronoEntity.h.

191 { return m_elapsed.flagMin(); }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:167
StatEntity::flagMin
double flagMin() const
minimal flag
Definition: StatEntity.h:406

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

r.m.s Elapsed Time

Definition at line 243 of file ChronoEntity.h.

243 { return m_elapsed.flagRMS(); }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:167
StatEntity::flagRMS
double flagRMS() const
r.m.s of flag
Definition: StatEntity.h:402

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

total Elapsed time

Definition at line 215 of file ChronoEntity.h.

215 { return m_elapsed.flag(); }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:167
StatEntity::flag
double flag() const
accumulated "flag"
Definition: StatEntity.h:396

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

114 {
115
117 boost::format fmt( "Tot=%2$5.3g%1$s %4$43s #=%3$3lu" );
118
119 static const auto tbl = {std::make_tuple( 500, microsecond, " [us]" ), std::make_tuple( 500, millisecond, " [ms]" ),
120 std::make_tuple( 500, second, " [s]" ), std::make_tuple( 500, minute, "[min]" ),
121 std::make_tuple( 500, hour, " [h]" ), std::make_tuple( 10, day, "[day]" ),
122 std::make_tuple( 5, week, " [w]" ), std::make_tuple( 20, month, "[mon]" ),
123 std::make_tuple( -1, year, " [y]" )};
124
125 auto i = std::find_if(
126 std::begin( tbl ), std::prev( std::end( tbl ) ),
127 [&]( const std::tuple<int, double, const char*>& i ) { return total < std::get<0>( i ) * std::get<1>( i ); } );
128 long double unit = std::get<1>( *i );
129 fmt % std::get<2>( *i ) % (double)( total / unit ) % number;
130
131 if ( number > 1 ) {
133 boost::format fmt1( "Ave/Min/Max=%2$5.3g(+-%3$5.3g)/%4$5.3g/%5$5.3g%1$s" );
134 auto i = std::find_if(
135 std::begin( tbl ), std::prev( std::end( tbl ) ),
136 [&]( const std::tuple<int, double, const char*>& i ) { return total < std::get<0>( i ) * std::get<1>( i ); } );
137 unit = std::get<1>( *i );
138 fmt1 % std::get<2>( *i ) % (double)( mean / unit ) % (double)( rms / unit ) % (double)( minimal / unit ) %
139 (double)( maximal / unit );
140 fmt % fmt1.str();
141 } else {
142 fmt % "";
143 }
144
145 return fmt.str();
146 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
Gaudi::Units::microsecond
constexpr double microsecond
Definition: SystemOfUnits.h:125
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:123
GaudiPython.HistoUtils.mean
mean
Definition: HistoUtils.py:838
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:124
GaudiPython.HistoUtils.rms
rms
Definition: HistoUtils.py:842

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

maximal measurement for kernel time

Definition at line 199 of file ChronoEntity.h.

199 { return m_kernel.flagMax(); }
StatEntity::flagMax
double flagMax() const
maximal flag
Definition: StatEntity.h:408
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:165

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

error in mean Kernel time

Definition at line 247 of file ChronoEntity.h.

247 { return m_kernel.flagMeanErr(); }
StatEntity::flagMeanErr
double flagMeanErr() const
error in mean value of flag
Definition: StatEntity.h:404
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:165

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

average Kernel Time

Definition at line 223 of file ChronoEntity.h.

223 { return m_kernel.flagMean(); }
StatEntity::flagMean
double flagMean() const
mean value of flag
Definition: StatEntity.h:400
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:165

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

minimal measurement for kernel time

Definition at line 187 of file ChronoEntity.h.

187 { return m_kernel.flagMin(); }
StatEntity::flagMin
double flagMin() const
minimal flag
Definition: StatEntity.h:406
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:165

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

r.m.s Kernel Time

Definition at line 235 of file ChronoEntity.h.

235 { return m_kernel.flagRMS(); }
StatEntity::flagRMS
double flagRMS() const
r.m.s of flag
Definition: StatEntity.h:402
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:165

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

total Kernel time

Definition at line 211 of file ChronoEntity.h.

211 { return m_kernel.flag(); }
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:165
StatEntity::flag
double flag() const
accumulated "flag"
Definition: StatEntity.h:396

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

number of chrono measurements

Definition at line 179 of file ChronoEntity.h.

179 { return m_user.nEntries(); }
StatEntity::nEntries
const unsigned long & nEntries() const
getters – no synchronization!
Definition: StatEntity.h:92
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:163

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

Compound assignment operator.

Definition at line 172 of file ChronoEntity.cpp.

173 {
174 // System::ProcessTime type
175 m_delta += e.m_delta;
176
177 // Summing, massaging here does not make too much sense.
178 // This is done only for final reductions
179 // Keep by convention the original one.
180 // m_start += e.m_start;
181
182 // Tymevaluetypes type
183 m_user += e.m_user;
184 m_kernel += e.m_kernel;
185 m_elapsed += e.m_elapsed;
186
187 return *this;
188 }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:167
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:163
ChronoEntity::m_delta
System::ProcessTime m_delta
delta process times
Definition: ChronoEntity.h:159
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:165

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

comparison operator

Definition at line 150 of file ChronoEntity.cpp.

151 {
152 return ( &e == this )
153 ? false
154 : ( totalTime() < e.totalTime() )
155 ? true
156 : ( totalTime() > e.totalTime() )
157 ? false
158 : ( m_user < e.m_user )
159 ? true
160 : ( e.m_user < m_user ) ? false
161 : ( m_kernel < e.m_kernel )
162 ? true
163 : ( e.m_kernel < m_kernel )
164 ? false
165 : ( m_elapsed < e.m_elapsed )
166 ? true
167 : ( e.m_elapsed < m_elapsed ) ? false : false;
168 }
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:167
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:163
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:165
ChronoEntity::totalTime
double totalTime() const
total time
Definition: ChronoEntity.h:219

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

print the chrono ;

Definition at line 104 of file ChronoEntity.cpp.

105 {
106 return "TimeElapsed: " +
107 format( eTotalTime(), eMinimalTime(), eMeanTime(), eRMSTime(), eMaximalTime(), nOfMeasurements() );
108 }
ChronoEntity::eMinimalTime
double eMinimalTime() const
minimal measurement for elapsed time
Definition: ChronoEntity.h:191
ChronoEntity::eMeanTime
double eMeanTime() const
average Elapsed Time
Definition: ChronoEntity.h:231
ChronoEntity::eRMSTime
double eRMSTime() const
r.m.s Elapsed Time
Definition: ChronoEntity.h:243
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:112
ChronoEntity::eMaximalTime
double eMaximalTime() const
maximal measurement for elapsed time
Definition: ChronoEntity.h:203
ChronoEntity::nOfMeasurements
unsigned long nOfMeasurements() const
number of chrono measurements
Definition: ChronoEntity.h:179
ChronoEntity::eTotalTime
double eTotalTime() const
total Elapsed time
Definition: ChronoEntity.h:215

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

307 {
308 return outputTime( IChronoSvc::ELAPSED, fmt, unit );
309 }
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:199
IChronoSvc::ELAPSED
Definition: IChronoSvc.h:48

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

print the chrono ;

Definition at line 97 of file ChronoEntity.cpp.

98 {
99 return "Time System : " +
100 format( kTotalTime(), kMinimalTime(), kMeanTime(), kRMSTime(), kMaximalTime(), nOfMeasurements() );
101 }
ChronoEntity::kMaximalTime
double kMaximalTime() const
maximal measurement for kernel time
Definition: ChronoEntity.h:199
ChronoEntity::kTotalTime
double kTotalTime() const
total Kernel time
Definition: ChronoEntity.h:211
ChronoEntity::kMinimalTime
double kMinimalTime() const
minimal measurement for kernel time
Definition: ChronoEntity.h:187
ChronoEntity::kRMSTime
double kRMSTime() const
r.m.s Kernel Time
Definition: ChronoEntity.h:235
ChronoEntity::kMeanTime
double kMeanTime() const
average Kernel Time
Definition: ChronoEntity.h:223
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:112
ChronoEntity::nOfMeasurements
unsigned long nOfMeasurements() const
number of chrono measurements
Definition: ChronoEntity.h:179

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.

295 {
296 return outputTime( IChronoSvc::KERNEL, fmt, unit );
297 }
IChronoSvc::KERNEL
Definition: IChronoSvc.h:48
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:199

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

200 {
201 boost::format _fmt( fmt );
202 // allow various number of arguments
203 using namespace boost::io;
204 _fmt.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
205 //
206 double _unit = microsecond;
207 switch ( unit ) {
208 case System::Year:
209 _unit = year;
210 break;
211 case System::Month:
212 _unit = month;
213 break;
214 case System::Day:
215 _unit = day;
216 break;
217 case System::Hour:
218 _unit = hour;
219 break;
220 case System::Min:
221 _unit = minute;
222 break;
223 case System::Sec:
224 _unit = second;
225 break;
226 case System::milliSec:
227 _unit = millisecond;
228 break;
229 case System::microSec:
230 _unit = microsecond;
231 break;
232 case System::nanoSec:
233 _unit = nanosecond;
234 break;
235 default:
236 _unit = microsecond;
237 break;
238 }
239 //
240 const StatEntity* stat = &m_user;
241 switch ( typ ) {
242 case IChronoSvc::USER:
243 stat = &m_user;
244 break;
245 case IChronoSvc::KERNEL:
246 stat = &m_kernel;
247 break;
248 case IChronoSvc::ELAPSED:
249 stat = &m_elapsed;
250 break;
251 default:
252 stat = &m_user;
253 break;
254 }
255 //
256 _fmt % ( stat->nEntries() ) // %1 : #entries
257 % ( stat->flag() / _unit ) // %2 : total time
258 % ( stat->flagMean() / _unit ) // %3 : mean time
259 % ( stat->flagRMS() / _unit ) // %4 : RMS time
260 % ( stat->flagMeanErr() / _unit ) // %5 : error in mean time
261 % ( stat->flagMin() / _unit ) // %6 : minimal time
262 % ( stat->flagMax() / _unit ); // %7 : maximal time
263 //
264 return _fmt.str();
265 }
StatEntity::nEntries
const unsigned long & nEntries() const
getters – no synchronization!
Definition: StatEntity.h:92
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
ChronoEntity::m_elapsed
StatEntity m_elapsed
the actual storage of "elapsed" time
Definition: ChronoEntity.h:167
StatEntity::flagRMS
double flagRMS() const
r.m.s of flag
Definition: StatEntity.h:402
StatEntity::flagMin
double flagMin() const
minimal flag
Definition: StatEntity.h:406
System::Min
Definition: Timing.h:58
Gaudi::Units::microsecond
constexpr double microsecond
Definition: SystemOfUnits.h:125
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:163
IChronoSvc::KERNEL
Definition: IChronoSvc.h:48
StatEntity::flagMeanErr
double flagMeanErr() const
error in mean value of flag
Definition: StatEntity.h:404
System::Hour
Definition: Timing.h:58
System::milliSec
Definition: Timing.h:58
System::Sec
Definition: Timing.h:58
StatEntity::flagMax
double flagMax() const
maximal flag
Definition: StatEntity.h:408
Gaudi::Units::second
constexpr double second
Definition: SystemOfUnits.h:123
IChronoSvc::USER
Definition: IChronoSvc.h:48
System::microSec
Definition: Timing.h:58
StatEntity::flagMean
double flagMean() const
mean value of flag
Definition: StatEntity.h:400
ChronoEntity::m_kernel
StatEntity m_kernel
the actual storage of "kernel" time
Definition: ChronoEntity.h:165
IChronoSvc::ELAPSED
Definition: IChronoSvc.h:48
System::Month
Definition: Timing.h:58
System::nanoSec
Definition: Timing.h:58
Gaudi::Units::nanosecond
constexpr double nanosecond
Definition: SystemOfUnits.h:122
Gaudi::Units::millisecond
constexpr double millisecond
Definition: SystemOfUnits.h:124
System::Year
Definition: Timing.h:58
StatEntity
The basic counter used for Monitoring purposes.
Definition: StatEntity.h:65
StatEntity::flag
double flag() const
accumulated "flag"
Definition: StatEntity.h:396
System::Day
Definition: Timing.h:58

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

print the chrono ;

Definition at line 89 of file ChronoEntity.cpp.

90 {
91 return "Time User : " +
92 format( uTotalTime(), uMinimalTime(), uMeanTime(), uRMSTime(), uMaximalTime(), nOfMeasurements() );
93 }
ChronoEntity::uMinimalTime
double uMinimalTime() const
minimal measurement for user time
Definition: ChronoEntity.h:183
ChronoEntity::uTotalTime
double uTotalTime() const
total user time
Definition: ChronoEntity.h:207
ChronoEntity::uRMSTime
double uRMSTime() const
r.m.s User Time
Definition: ChronoEntity.h:239
ChronoEntity::uMeanTime
double uMeanTime() const
average User Time
Definition: ChronoEntity.h:227
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:112
ChronoEntity::nOfMeasurements
unsigned long nOfMeasurements() const
number of chrono measurements
Definition: ChronoEntity.h:179
ChronoEntity::uMaximalTime
double uMaximalTime() const
maximal measurement for user time
Definition: ChronoEntity.h:195

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 282 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:199
IChronoSvc::USER
Definition: IChronoSvc.h:48

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

start the current chrono

Definition at line 47 of file ChronoEntity.cpp.

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

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

return the status of chrono

Definition at line 175 of file ChronoEntity.h.

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

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

stop the chrono

Definition at line 65 of file ChronoEntity.cpp.

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

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

total time

Definition at line 219 of file ChronoEntity.h.

219 { return uTotalTime() + kTotalTime(); }
ChronoEntity::uTotalTime
double uTotalTime() const
total user time
Definition: ChronoEntity.h:207
ChronoEntity::kTotalTime
double kTotalTime() const
total Kernel time
Definition: ChronoEntity.h:211

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

maximal measurement for user time

Definition at line 195 of file ChronoEntity.h.

195 { return m_user.flagMax(); }
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:163
StatEntity::flagMax
double flagMax() const
maximal flag
Definition: StatEntity.h:408

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

error in mean User time

Definition at line 251 of file ChronoEntity.h.

251 { return m_user.flagMeanErr(); }
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:163
StatEntity::flagMeanErr
double flagMeanErr() const
error in mean value of flag
Definition: StatEntity.h:404

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

average User Time

Definition at line 227 of file ChronoEntity.h.

227 { return m_user.flagMean(); }
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:163
StatEntity::flagMean
double flagMean() const
mean value of flag
Definition: StatEntity.h:400

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

minimal measurement for user time

Definition at line 183 of file ChronoEntity.h.

183 { return m_user.flagMin(); }
StatEntity::flagMin
double flagMin() const
minimal flag
Definition: StatEntity.h:406
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:163

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

r.m.s User Time

Definition at line 239 of file ChronoEntity.h.

239 { return m_user.flagRMS(); }
StatEntity::flagRMS
double flagRMS() const
r.m.s of flag
Definition: StatEntity.h:402
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:163

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

total user time

Definition at line 207 of file ChronoEntity.h.

207 { return m_user.flag(); }
ChronoEntity::m_user
StatEntity m_user
the actual storage of "user" time
Definition: ChronoEntity.h:163
StatEntity::flag
double flag() const
accumulated "flag"
Definition: StatEntity.h:396

## Member Data Documentation

System::ProcessTime ChronoEntity::m_delta
| private

delta process times

Definition at line 159 of file ChronoEntity.h.

StatEntity ChronoEntity::m_elapsed
| private

the actual storage of "elapsed" time

Definition at line 167 of file ChronoEntity.h.

StatEntity ChronoEntity::m_kernel
| private

the actual storage of "kernel" time

Definition at line 165 of file ChronoEntity.h.

System::ProcessTime ChronoEntity::m_start
| private

start stamp for current measurement of process times

Definition at line 161 of file ChronoEntity.h.

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

current status of this chrono object;

Definition at line 157 of file ChronoEntity.h.

StatEntity ChronoEntity::m_user
| private

the actual storage of "user" time

Definition at line 163 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 169 of file ChronoEntity.h.

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

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