![]() |
|
|
Generated: 18 Jul 2008 |
00001 // ChronoAuditor: 00002 // An auditor that monitors memory usage 00003 00004 #include "ChronoAuditor.h" 00005 #include "GaudiKernel/MsgStream.h" 00006 #include "GaudiKernel/INamedInterface.h" 00007 #include "GaudiKernel/AudFactory.h" 00008 #include "GaudiKernel/IChronoStatSvc.h" 00009 #include "GaudiKernel/Chrono.h" 00010 00011 DECLARE_AUDITOR_FACTORY(ChronoAuditor); 00012 00013 ChronoAuditor::ChronoAuditor(const std::string& name, ISvcLocator* pSvcLocator) 00014 : Auditor(name, pSvcLocator) { 00015 service( "ChronoStatSvc", m_chronoSvc, true).ignore(); 00016 } 00017 00018 ChronoAuditor::~ChronoAuditor(){ 00019 m_chronoSvc->release(); 00020 } 00021 00022 void ChronoAuditor::beforeInitialize(INamedInterface* alg) { 00023 chronoSvc( )->chronoStart( alg->name() + ":initialize" ) ; 00024 } 00025 void ChronoAuditor:: afterInitialize(INamedInterface* alg){ 00026 chronoSvc( )->chronoStop( alg->name() + ":initialize" ) ; 00027 } 00028 00029 void ChronoAuditor::beforeReinitialize(INamedInterface* alg) { 00030 chronoSvc( )->chronoStart( alg->name() + ":reinitialize" ) ; 00031 } 00032 void ChronoAuditor:: afterReinitialize(INamedInterface* alg){ 00033 chronoSvc( )->chronoStop( alg->name() + ":reinitialize" ) ; 00034 } 00035 00036 void ChronoAuditor:: beforeExecute(INamedInterface* alg){ 00037 chronoSvc( )->chronoStart( alg->name() + ":execute" ) ; 00038 } 00039 void ChronoAuditor:: afterExecute(INamedInterface* alg, const StatusCode& ) { 00040 chronoSvc( )->chronoStop( alg->name() + ":execute" ) ; 00041 } 00042 00043 void ChronoAuditor::beforeBeginRun(INamedInterface* alg) { 00044 chronoSvc( )->chronoStart( alg->name() + ":beginRun" ) ; 00045 } 00046 void ChronoAuditor:: afterBeginRun(INamedInterface* alg){ 00047 chronoSvc( )->chronoStop( alg->name() + ":beginRun" ) ; 00048 } 00049 void ChronoAuditor::beforeEndRun(INamedInterface* alg) { 00050 chronoSvc( )->chronoStart( alg->name() + ":endRun" ) ; 00051 } 00052 void ChronoAuditor:: afterEndRun(INamedInterface* alg){ 00053 chronoSvc( )->chronoStop( alg->name() + ":endRun" ) ; 00054 } 00055 00056 00057 void ChronoAuditor:: beforeFinalize(INamedInterface* alg) { 00058 chronoSvc( )->chronoStart( alg->name() + ":finalize" ) ; 00059 } 00060 void ChronoAuditor:: afterFinalize(INamedInterface* alg){ 00061 chronoSvc( )->chronoStop( alg->name() + ":finalize" ) ; 00062 }