#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 31 of file ChronoEntity.h.
◆ ChronoEntity()
ChronoEntity::ChronoEntity |
( |
| ) |
|
|
default |
◆ delta()
return the last delta-time of type "type"
Definition at line 271 of file ChronoEntity.h.
◆ eMaximalTime()
double ChronoEntity::eMaximalTime |
( |
| ) |
const |
|
inline |
◆ eMeanErrorTime()
double ChronoEntity::eMeanErrorTime |
( |
| ) |
const |
|
inline |
◆ eMeanTime()
double ChronoEntity::eMeanTime |
( |
| ) |
const |
|
inline |
◆ eMinimalTime()
double ChronoEntity::eMinimalTime |
( |
| ) |
const |
|
inline |
◆ eRMSTime()
double ChronoEntity::eRMSTime |
( |
| ) |
const |
|
inline |
◆ eTotalTime()
double ChronoEntity::eTotalTime |
( |
| ) |
const |
|
inline |
◆ 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
Definition at line 102 of file ChronoEntity.cpp.
106 constexpr
auto fmt =
"Tot={1:5.3g}{0:5} {3} #={2:3}";
107 constexpr
auto stat_fmt =
"Ave/Min/Max={1:8.3g}(+-{2:8.3g})/{3:8.3g}/{4:8.3g}{0:5}";
112 { 500, minute,
"[min]" },
113 { 500, hour,
" [h]" },
114 { 10, day,
"[day]" },
116 { 20, month,
"[mon]" },
117 { -1, year,
" [y]" } } };
120 [&](
const auto& i ) {
return total < std::get<0>( i ) * std::get<1>( i ); } );
121 long double unit = std::get<1>( *i );
122 std::string_view unit_name = std::get<2>( *i );
127 [&](
const auto& i ) {
return total < std::get<0>( i ) * std::get<1>( i ); } );
128 auto unit = std::get<1>( *i );
129 std::string_view unit_name = std::get<2>( *i );
130 return fmt::format( stat_fmt, unit_name, (
double)( mean / unit ), (
double)( rms / unit ),
131 (
double)( minimal / unit ), (
double)( maximal / unit ) );
137 return fmt::format(
fmt, unit_name, (
double)( total / unit ), number, stats() );
◆ kMaximalTime()
double ChronoEntity::kMaximalTime |
( |
| ) |
const |
|
inline |
◆ kMeanErrorTime()
double ChronoEntity::kMeanErrorTime |
( |
| ) |
const |
|
inline |
◆ kMeanTime()
double ChronoEntity::kMeanTime |
( |
| ) |
const |
|
inline |
◆ kMinimalTime()
double ChronoEntity::kMinimalTime |
( |
| ) |
const |
|
inline |
◆ kRMSTime()
double ChronoEntity::kRMSTime |
( |
| ) |
const |
|
inline |
◆ kTotalTime()
double ChronoEntity::kTotalTime |
( |
| ) |
const |
|
inline |
◆ nOfMeasurements()
unsigned long ChronoEntity::nOfMeasurements |
( |
| ) |
const |
|
inline |
◆ operator+=()
◆ outputElapsedTime() [1/2]
print the chrono ;
Definition at line 95 of file ChronoEntity.cpp.
96 return "TimeElapsed: " +
◆ 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 315 of file ChronoEntity.h.
◆ outputSystemTime() [1/2]
print the chrono ;
Definition at line 89 of file ChronoEntity.cpp.
90 return "Time System : " +
◆ 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 304 of file ChronoEntity.h.
◆ 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 168 of file ChronoEntity.cpp.
171 using namespace boost::io;
172 _fmt.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
224 _fmt % ( stat->nEntries() )
225 % ( stat->
flag() / _unit )
◆ outputUserTime() [1/2]
print the chrono ;
Definition at line 82 of file ChronoEntity.cpp.
83 return "Time User : " +
◆ 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 293 of file ChronoEntity.h.
◆ start()
◆ status()
◆ stop()
◆ totalTime()
double ChronoEntity::totalTime |
( |
| ) |
const |
|
inline |
◆ uMaximalTime()
double ChronoEntity::uMaximalTime |
( |
| ) |
const |
|
inline |
◆ uMeanErrorTime()
double ChronoEntity::uMeanErrorTime |
( |
| ) |
const |
|
inline |
◆ uMeanTime()
double ChronoEntity::uMeanTime |
( |
| ) |
const |
|
inline |
◆ uMinimalTime()
double ChronoEntity::uMinimalTime |
( |
| ) |
const |
|
inline |
◆ uRMSTime()
double ChronoEntity::uRMSTime |
( |
| ) |
const |
|
inline |
◆ uTotalTime()
double ChronoEntity::uTotalTime |
( |
| ) |
const |
|
inline |
◆ operator<
comparison operator
Definition at line 99 of file ChronoEntity.h.
100 return std::make_tuple( lhs.totalTime(), lhs.m_user, lhs.m_kernel, lhs.m_elapsed ) <
101 std::make_tuple( rhs.totalTime(), rhs.m_user, rhs.m_kernel, rhs.m_elapsed );
◆ m_delta
◆ m_elapsed
◆ m_kernel
◆ m_start
start stamp for current measurement of process times
Definition at line 173 of file ChronoEntity.h.
◆ m_status
◆ m_user
◆ TimeUnit
internal unit used for the system time conversion (microseconds)
Definition at line 181 of file ChronoEntity.h.
The documentation for this class was generated from the following files:
StatEntity m_user
the actual storage of "user" time
StatEntity m_elapsed
the actual storage of "elapsed" time
double eMinimalTime() const
minimal measurement for elapsed time
double ChronoTime
Type of the delta-time.
double uMinimalTime() const
minimal measurement for user time
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
backward compatible StatEntity class.
double eMeanTime() const
average Elapsed Time
TimeValueType kernelTime() const
Retrieve the kernel time in the requested unit.
double eTotalTime() const
total Elapsed time
double kMinimalTime() const
minimal measurement for kernel time
System::ProcessTime m_delta
delta process times
unsigned long nOfMeasurements() const
number of chrono measurements
IChronoSvc::ChronoStatus m_status
current status of this chrono object;
double uMeanTime() const
average User Time
constexpr double microsecond
double flagMeanErr() const
TimeValueType elapsedTime() const
Retrieve the elapsed time in the requested unit.
AttribStringParser::Iterator begin(const AttribStringParser &parser)
double kRMSTime() const
r.m.s Kernel Time
double kTotalTime() const
total Kernel time
System::ProcessTime m_start
start stamp for current measurement of process times
StatEntity m_kernel
the actual storage of "kernel" time
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
double kMaximalTime() const
maximal measurement for kernel time
double uRMSTime() const
r.m.s User Time
constexpr double nanosecond
double kMeanTime() const
average Kernel Time
constexpr double millisecond
static const System::TimeType TimeUnit
internal unit used for the system time conversion (microseconds)
double uMaximalTime() const
maximal measurement for user time
TimeValueType userTime() const
Retrieve the user time in the requested unit.
GAUDI_API ProcessTime getProcessTime(long pid=-1)
Retrieve the process time data for a process.
std::string outputTime(IChronoSvc::ChronoType typ, std::string_view fmt, System::TimeType unit) const
print the chrono according the format and units
double eMaximalTime() const
maximal measurement for elapsed time
double uTotalTime() const
total user time