a small helper class for implementation of ChronoStatSvc service, It also could be used as some local timer
More...
#include <GaudiKernel/ChronoEntity.h>
|
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...
|
|
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.
◆ ChronoEntity()
ChronoEntity::ChronoEntity |
( |
| ) |
|
|
default |
◆ delta()
return the last delta-time of type "type"
Definition at line 261 of file ChronoEntity.h.
TimeValueType userTime() const
Retrieve the user time in the requested unit.
TimeValueType elapsedTime() const
Retrieve the elapsed time in the requested unit.
TimeValueType kernelTime() const
Retrieve the kernel time in the requested unit.
System::ProcessTime m_delta
delta process times
double ChronoTime
Type of the delta-time.
static const System::TimeType TimeUnit
internal unit used for the system time conversion (microseconds)
◆ eMaximalTime()
double ChronoEntity::eMaximalTime |
( |
| ) |
const |
|
inline |
maximal measurement for elapsed time
Definition at line 205 of file ChronoEntity.h.
StatEntity m_elapsed
the actual storage of "elapsed" time
◆ eMeanErrorTime()
double ChronoEntity::eMeanErrorTime |
( |
| ) |
const |
|
inline |
error in mean Elapsed time
Definition at line 257 of file ChronoEntity.h.
StatEntity m_elapsed
the actual storage of "elapsed" time
◆ eMeanTime()
double ChronoEntity::eMeanTime |
( |
| ) |
const |
|
inline |
average Elapsed Time
Definition at line 233 of file ChronoEntity.h.
StatEntity m_elapsed
the actual storage of "elapsed" time
◆ eMinimalTime()
double ChronoEntity::eMinimalTime |
( |
| ) |
const |
|
inline |
minimal measurement for elapsed time
Definition at line 193 of file ChronoEntity.h.
StatEntity m_elapsed
the actual storage of "elapsed" time
◆ eRMSTime()
double ChronoEntity::eRMSTime |
( |
| ) |
const |
|
inline |
r.m.s Elapsed Time
Definition at line 245 of file ChronoEntity.h.
StatEntity m_elapsed
the actual storage of "elapsed" time
◆ eTotalTime()
double ChronoEntity::eTotalTime |
( |
| ) |
const |
|
inline |
total Elapsed time
Definition at line 217 of file ChronoEntity.h.
StatEntity m_elapsed
the actual storage of "elapsed" time
◆ 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.
117 long double unit = std::get<1>( *i );
118 fmt % std::get<2>( *i ) % (double)( total / unit ) % number;
122 boost::format fmt1(
"Ave/Min/Max=%2$5.3g(+-%3$5.3g)/%4$5.3g/%5$5.3g%1$s" );
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 );
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
constexpr double microsecond
constexpr double millisecond
◆ kMaximalTime()
double ChronoEntity::kMaximalTime |
( |
| ) |
const |
|
inline |
maximal measurement for kernel time
Definition at line 201 of file ChronoEntity.h.
StatEntity m_kernel
the actual storage of "kernel" time
◆ kMeanErrorTime()
double ChronoEntity::kMeanErrorTime |
( |
| ) |
const |
|
inline |
error in mean Kernel time
Definition at line 249 of file ChronoEntity.h.
StatEntity m_kernel
the actual storage of "kernel" time
◆ kMeanTime()
double ChronoEntity::kMeanTime |
( |
| ) |
const |
|
inline |
average Kernel Time
Definition at line 225 of file ChronoEntity.h.
StatEntity m_kernel
the actual storage of "kernel" time
◆ kMinimalTime()
double ChronoEntity::kMinimalTime |
( |
| ) |
const |
|
inline |
minimal measurement for kernel time
Definition at line 189 of file ChronoEntity.h.
StatEntity m_kernel
the actual storage of "kernel" time
◆ kRMSTime()
double ChronoEntity::kRMSTime |
( |
| ) |
const |
|
inline |
r.m.s Kernel Time
Definition at line 237 of file ChronoEntity.h.
StatEntity m_kernel
the actual storage of "kernel" time
◆ kTotalTime()
double ChronoEntity::kTotalTime |
( |
| ) |
const |
|
inline |
total Kernel time
Definition at line 213 of file ChronoEntity.h.
StatEntity m_kernel
the actual storage of "kernel" time
◆ nOfMeasurements()
unsigned long ChronoEntity::nOfMeasurements |
( |
| ) |
const |
|
inline |
number of chrono measurements
Definition at line 181 of file ChronoEntity.h.
181 {
return m_user.nEntries(); }
StatEntity m_user
the actual storage of "user" time
◆ operator+=()
Compound assignment operator.
Definition at line 139 of file ChronoEntity.cpp.
StatEntity m_elapsed
the actual storage of "elapsed" time
StatEntity m_user
the actual storage of "user" time
System::ProcessTime m_delta
delta process times
StatEntity m_kernel
the actual storage of "kernel" time
◆ outputElapsedTime() [1/2]
print the chrono ;
Definition at line 95 of file ChronoEntity.cpp.
96 return "TimeElapsed: " +
double eRMSTime() const
r.m.s Elapsed Time
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
unsigned long nOfMeasurements() const
number of chrono measurements
double eMinimalTime() const
minimal measurement for elapsed time
double eTotalTime() const
total Elapsed time
double eMeanTime() const
average Elapsed Time
◆ outputElapsedTime() [2/2]
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.
std::string outputTime(IChronoSvc::ChronoType typ, const std::string &fmt, System::TimeType unit) const
print the chrono according the format and units
◆ outputSystemTime() [1/2]
print the chrono ;
Definition at line 89 of file ChronoEntity.cpp.
90 return "Time System : " +
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 kRMSTime() const
r.m.s Kernel Time
unsigned long nOfMeasurements() const
number of chrono measurements
double kMeanTime() const
average Kernel Time
double kTotalTime() const
total Kernel time
double kMinimalTime() const
minimal measurement for kernel time
double kMaximalTime() const
maximal measurement for kernel time
◆ outputSystemTime() [2/2]
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.
std::string outputTime(IChronoSvc::ChronoType typ, const std::string &fmt, System::TimeType unit) const
print the chrono according the format and units
◆ outputTime()
print the chrono according the format and units
The format fields are:
- number of entries
- total time (in the specified units)
- mean time (in the specified units)
- r.m.s. time (in the specified units)
- error in mean time (in the specified units)
- minimal time (in the specified units)
- 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.
169 using namespace boost::io;
170 _fmt.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
206 const StatEntity* stat = &
m_user;
222 _fmt % ( stat->nEntries() )
223 % ( stat->flag() / _unit )
224 % ( stat->flagMean() / _unit )
225 % ( stat->flagRMS() / _unit )
226 % ( stat->flagMeanErr() / _unit )
227 % ( stat->flagMin() / _unit )
228 % ( stat->flagMax() / _unit );
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
StatEntity m_elapsed
the actual storage of "elapsed" time
constexpr double microsecond
StatEntity m_user
the actual storage of "user" time
StatEntity m_kernel
the actual storage of "kernel" time
constexpr double nanosecond
constexpr double millisecond
◆ outputUserTime() [1/2]
print the chrono ;
Definition at line 82 of file ChronoEntity.cpp.
83 return "Time User : " +
double uMinimalTime() const
minimal measurement for user time
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 uTotalTime() const
total user time
unsigned long nOfMeasurements() const
number of chrono measurements
double uMeanTime() const
average User Time
double uMaximalTime() const
maximal measurement for user time
double uRMSTime() const
r.m.s User Time
◆ outputUserTime() [2/2]
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.
std::string outputTime(IChronoSvc::ChronoType typ, const std::string &fmt, System::TimeType unit) const
print the chrono according the format and units
◆ start()
start the current chrono
Definition at line 46 of file ChronoEntity.cpp.
IChronoSvc::ChronoStatus m_status
current status of this chrono object;
System::ProcessTime m_start
start stamp for current measurement of process times
GAUDI_API ProcessTime getProcessTime(long pid=-1)
Retrieve the process time data for a process.
◆ status()
return the status of chrono
Definition at line 177 of file ChronoEntity.h.
IChronoSvc::ChronoStatus m_status
current status of this chrono object;
◆ stop()
stop the chrono
Definition at line 61 of file ChronoEntity.cpp.
TimeValueType userTime() const
Retrieve the user time in the requested unit.
IChronoSvc::ChronoStatus m_status
current status of this chrono object;
StatEntity m_elapsed
the actual storage of "elapsed" time
TimeValueType elapsedTime() const
Retrieve the elapsed time in the requested unit.
StatEntity m_user
the actual storage of "user" time
TimeValueType kernelTime() const
Retrieve the kernel time in the requested unit.
System::ProcessTime m_start
start stamp for current measurement of process times
System::ProcessTime m_delta
delta process times
StatEntity m_kernel
the actual storage of "kernel" time
GAUDI_API ProcessTime getProcessTime(long pid=-1)
Retrieve the process time data for a process.
static const System::TimeType TimeUnit
internal unit used for the system time conversion (microseconds)
◆ totalTime()
double ChronoEntity::totalTime |
( |
| ) |
const |
|
inline |
total time
Definition at line 221 of file ChronoEntity.h.
double uTotalTime() const
total user time
double kTotalTime() const
total Kernel time
◆ uMaximalTime()
double ChronoEntity::uMaximalTime |
( |
| ) |
const |
|
inline |
maximal measurement for user time
Definition at line 197 of file ChronoEntity.h.
197 {
return m_user.flagMax(); }
StatEntity m_user
the actual storage of "user" time
◆ uMeanErrorTime()
double ChronoEntity::uMeanErrorTime |
( |
| ) |
const |
|
inline |
error in mean User time
Definition at line 253 of file ChronoEntity.h.
253 {
return m_user.flagMeanErr(); }
StatEntity m_user
the actual storage of "user" time
◆ uMeanTime()
double ChronoEntity::uMeanTime |
( |
| ) |
const |
|
inline |
average User Time
Definition at line 229 of file ChronoEntity.h.
229 {
return m_user.flagMean(); }
StatEntity m_user
the actual storage of "user" time
◆ uMinimalTime()
double ChronoEntity::uMinimalTime |
( |
| ) |
const |
|
inline |
minimal measurement for user time
Definition at line 185 of file ChronoEntity.h.
185 {
return m_user.flagMin(); }
StatEntity m_user
the actual storage of "user" time
◆ uRMSTime()
double ChronoEntity::uRMSTime |
( |
| ) |
const |
|
inline |
r.m.s User Time
Definition at line 241 of file ChronoEntity.h.
241 {
return m_user.flagRMS(); }
StatEntity m_user
the actual storage of "user" time
◆ uTotalTime()
double ChronoEntity::uTotalTime |
( |
| ) |
const |
|
inline |
total user time
Definition at line 209 of file ChronoEntity.h.
StatEntity m_user
the actual storage of "user" time
◆ operator<
comparison operator
Definition at line 89 of file ChronoEntity.h.
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 );
◆ m_delta
◆ m_elapsed
StatEntity ChronoEntity::m_elapsed |
|
private |
◆ m_kernel
StatEntity ChronoEntity::m_kernel |
|
private |
◆ m_start
start stamp for current measurement of process times
Definition at line 163 of file ChronoEntity.h.
◆ m_status
◆ m_user
StatEntity ChronoEntity::m_user |
|
private |
◆ TimeUnit
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: