2 #pragma warning( disable : 4786 ) 45 template <
typename S,
typename T>
63 const IChronoStatSvc::ChronoTag& key = item.first;
73 const IChronoStatSvc::StatTag& key = item.first;
122 ii->addListener(
this, IncidentType::EndEvent );
156 m_ofd << itr.first.substr( 0, itr.first.length() - 8 ) <<
" ";
157 for (
const auto& itt : itr.second ) {
158 m_ofd <<
" " << (
long int)( itt );
174 std::cout << local <<
" The Final CPU consumption (Chrono) Table " 194 for (
auto iter = tmpCont.
begin(); tmpCont.
end() != iter; ++iter ) {
200 const ChronoTag* tag = iter->second;
227 for (
auto iter = tmpCont.
begin(); tmpCont.
end() != iter; ++iter ) {
233 const ChronoTag* tag = iter->second;
260 for (
const auto& i : tmpCont ) {
266 const ChronoTag* tag = i.second;
331 IChronoStatSvc::ChronoType theType )
358 void ChronoStatSvc::stat(
const IChronoStatSvc::StatTag& statTag,
const IChronoStatSvc::StatFlag& statFlag )
371 theStat = &theIter->second;
415 info() <<
"Could not open the output file for writing chrono statistics [" <<
m_statsOutFileName.value() <<
"]" 427 []( ChronoMap::const_reference i ) {
return std::make_pair( &i.second, &i.first ); } );
433 for (
const auto& iter : chronos ) {
440 const ChronoTag* tag = iter.second;
446 out <<
"\n[" << *tag <<
"]\n";
449 out <<
"cpu_user_total = " << entity->
uTotalTime() <<
"\n";
450 out <<
"cpu_user_min = " << entity->
uMinimalTime() <<
"\n";
451 out <<
"cpu_user_mean = " << entity->
uMeanTime() <<
"\n";
452 out <<
"cpu_user_RMS = " << entity->
uRMSTime() <<
"\n";
453 out <<
"cpu_user_max = " << entity->
uMaximalTime() <<
"\n";
458 out <<
"cpu_system_total = " << entity->
kTotalTime() <<
"\n";
459 out <<
"cpu_system_min = " << entity->
kMinimalTime() <<
"\n";
460 out <<
"cpu_system_mean = " << entity->
kMeanTime() <<
"\n";
461 out <<
"cpu_system_RMS = " << entity->
kRMSTime() <<
"\n";
462 out <<
"cpu_system_max = " << entity->
kMaximalTime() <<
"\n";
467 out <<
"cpu_real_total = " << entity->
eTotalTime() <<
"\n";
468 out <<
"cpu_real_min = " << entity->
eMinimalTime() <<
"\n";
469 out <<
"cpu_real_mean = " << entity->
eMeanTime() <<
"\n";
470 out <<
"cpu_real_RMS = " << entity->
eRMSTime() <<
"\n";
471 out <<
"cpu_real_max = " << entity->
eMaximalTime() <<
"\n";
508 []( StatMap::const_reference i ) {
return std::make_pair( &i.second, &i.first ); } );
519 for (
const auto& iter : tmpCont ) {
525 const StatTag* tag = iter.second;
555 if ( itr.first.find(
":Execute" ) == std::string::npos )
continue;
Gaudi::Property< int > m_intStatPrintLevel
std::string outputElapsedTime() const
print the chrono ;
double kMaximalTime() const
maximal measurement for kernel time
Definition of the MsgStream class used to transmit messages.
StatusCode initialize() override
double uMinimalTime() const
minimal measurement for user time
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
const std::string & name() const override
Retrieve name of the service.
double uTotalTime() const
total user time
virtual ChronoStatus chronoStatus(const IChronoStatSvc::ChronoTag &chronoTag) override
Implementation of IChronoStatSvc::chronoStatus.
Gaudi::Property< std::string > m_header
StatusCode finalize() override
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
StatMap m_statEntities
stat part
a small helper class for implementation of ChronoStatSvc service, It also could be used as some local...
Gaudi::Property< bool > m_statCoutFlag
virtual IChronoStatSvc::ChronoTime chronoDelta(const IChronoStatSvc::ChronoTag &chronoTag, IChronoStatSvc::ChronoType theType) override
Implementation of IchronoStatSvc::chronoDelta.
double kTotalTime() const
total Kernel time
Gaudi::Property< long > m_numberOfSkippedEventsForMemStat
Gaudi::Property< bool > m_chronoOrderFlag
Gaudi::Property< bool > m_printUserTime
virtual void stat(const IChronoStatSvc::StatTag &statTag, const IChronoStatSvc::StatFlag &statFlag) override
Implementation of IChronoStatSvc::stat add statistical information to the entity , tagged by its name.
double uRMSTime() const
r.m.s User Time
double kMinimalTime() const
minimal measurement for kernel time
double eMinimalTime() const
minimal measurement for elapsed time
double kRMSTime() const
r.m.s Kernel Time
virtual void statPrint(const IChronoStatSvc::ChronoTag &statTag) override
prints (using message service) info about statistical entity, tagged by its name
std::string outputSystemTime() const
print the chrono ;
IChronoSvc::ChronoStatus start()
start the current chrono
bool isFailure() const
Test for a status code of FAILURE.
#define DECLARE_COMPONENT(type)
GAUDI_API std::string formatAsTableRow(const StatEntity &counter, const bool flag, const std::string &format1=" |%|7d| |%|11.7g| |%|#11.5g| |%|#10.5g| |%|#10.5g| |%|#10.5g| |", const std::string &format2="*|%|7d| |%|11.5g| |(%|#9.7g| +- %|-#8.6g|)%%| ----- | ----- |")
print the counter in a form of the table row
void setnEntriesBeforeReset(unsigned long nEntriesBeforeReset)
DR specify number of entry before reset.
virtual const ChronoEntity * chrono(const IChronoStatSvc::ChronoTag &t) const override
extract the chrono entity for the given tag (name)
double kMeanTime() const
average Kernel Time
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
double eMeanTime() const
average Elapsed Time
void merge(const ChronoStatSvc &css)
Compound assignment operator.
bool operator()(const std::pair< S *, T * > &p1, const std::pair< S *, T * > &p2) const
Gaudi::Property< bool > m_useEffFormat
void saveStats()
dump the statistics into an ASCII file for offline processing
Gaudi::Property< int > m_intChronoPrintLevel
constexpr struct CompareFirstOfPointerPair_t CompareFirstOfPointerPair
This class is used for returning status codes from appropriate routines.
void clear(STATE_TYPE _i=std::ios_base::failbit)
Gaudi::Property< std::string > m_format2
virtual const ChronoEntity * chronoStop(const IChronoStatSvc::ChronoTag &chronoTag) override
Implementation of IChronoStatSvc::chronoStop.
Gaudi::Property< bool > m_statOrderFlag
double eRMSTime() const
r.m.s Elapsed Time
Gaudi::Property< bool > m_chronoTableFlag
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Gaudi::Property< std::string > m_format1
unsigned long addFlag(const double Flag)
add a flag
StatusCode setProperties()
Method for setting declared properties to the values specified for the job.
MSG::Level m_chronoPrintLevel
level of info printing
StatusCode initialize() override
Implementation of IService::initialize()
Gaudi::Property< bool > m_printEllapsedTime
double uMeanTime() const
average User Time
std::string outputUserTime() const
print the chrono ;
HepRndm::Engine< TripleRand > e2
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
void handle(const Incident &incident) override
T back_inserter(T...args)
Gaudi::Property< bool > m_statTableFlag
double eMaximalTime() const
maximal measurement for elapsed time
Base class for all Incidents (computing events).
virtual ChronoEntity * chronoStart(const IChronoStatSvc::ChronoTag &chronoTag) override
Implementation of IChronoStatSvc::chronoStart.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
unsigned long nOfMeasurements() const
number of chrono measurements
Gaudi::Property< std::string > m_statsOutFileName
MSG::Level m_statPrintLevel
level of info printing
Gaudi::Property< bool > m_chronoCoutFlag
The basic counter used for Monitoring purposes.
IChronoSvc::ChronoStatus stop()
stop the chrono
double uMaximalTime() const
maximal measurement for user time
double eTotalTime() const
total Elapsed time
virtual void chronoPrint(const IChronoStatSvc::ChronoTag &chronoTag) override
Implementation of IChronoStatSvc::chronoPrint.
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
The interface implemented by the IncidentSvc service.
The Chrono & Stat Sservice: service implements the IChronoStatSvc interface and provides the basic ch...
ChronoMap m_chronoEntities
chrono part
Gaudi::Property< bool > m_printSystemTime
StatusCode finalize() override
Implementation of IService::finalize()
Gaudi::Property< std::string > m_perEventFile