ATLAS Offline Software
PerfMonAuditor.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // PerfMonAuditor.cxx
8 // Implementation file for class PerfMonAuditor
9 // Author: S.Binet<binet@cern.ch>
11 
12 
13 // STL includes
14 
15 // FrameWork includes
16 #include "GaudiKernel/INamedInterface.h"
17 #include "GaudiKernel/MsgStream.h"
18 
19 // PerfMonKernel includes
21 
22 // PerfMonComps includes
23 #include "PerfMonAuditor.h"
24 
25 using PerfMon::State;
26 using PerfMon::Steps;
27 using namespace Athena;
28 
30 // Public methods:
32 
33 // Constructors
35 PerfMonAuditor::PerfMonAuditor( const std::string& name,
36  ISvcLocator* pSvcLocator ) :
37  Auditor ( name, pSvcLocator ),
38  m_monSvc ( "PerfMonSvc/PerfMonSvc", name )
39 {
40  //
41  // Property declaration
42  //
43  //declareProperty( "Property", m_nProperty, "descr" );
44 
45  // for AuditorHandle ? someday ?
46  //declareInterface<IAuditor>(this);
47 }
48 
49 // Destructor
52 {
53  //m_msg << MSG::DEBUG << "Calling destructor" << endmsg;
54 }
55 
57 {
58  MsgStream msg( msgSvc(), name() );
59 
60  if ( !m_monSvc.retrieve().isSuccess() ) {
61  msg << MSG::ERROR
62  << "Could not retrieve [" << m_monSvc.typeAndName() << "] !!"
63  << endmsg;
64  return StatusCode::FAILURE;
65  }
66 
67  return StatusCode::SUCCESS;
68 }
69 
70 
72 // Non-const methods:
74 
75 void PerfMonAuditor::beforeInitialize( INamedInterface* component )
76 {
77  return m_monSvc->startAud( PerfMon::Steps[State::ini], component->name() );
78 }
79 
80 void PerfMonAuditor::afterInitialize( INamedInterface* component )
81 {
82  return m_monSvc->stopAud( PerfMon::Steps[State::ini], component->name() );
83 }
84 
85 void PerfMonAuditor::beforeReinitialize( INamedInterface* /*component*/ )
86 {
87  // don't poll for re-init...
88  return;
89 }
90 
91 void PerfMonAuditor::afterReinitialize( INamedInterface* /*component*/ )
92 {
93  // don't poll for re-init
94  return;
95 }
96 
97 void PerfMonAuditor::beforeExecute( INamedInterface* component )
98 {
99  return m_monSvc->startAud( PerfMon::Steps[State::evt], component->name() );
100 }
101 
102 void PerfMonAuditor::afterExecute( INamedInterface* component,
103  const StatusCode& )
104 {
105  return m_monSvc->stopAud( PerfMon::Steps[State::evt], component->name() );
106 }
107 
108 void PerfMonAuditor::beforeFinalize( INamedInterface* component )
109 {
110  return m_monSvc->startAud( PerfMon::Steps[State::fin], component->name() );
111 }
112 
113 void PerfMonAuditor::afterFinalize( INamedInterface* component )
114 {
115  return m_monSvc->stopAud( PerfMon::Steps[State::fin], component->name() );
116 }
117 
118 void PerfMonAuditor::before(CustomEventTypeRef evt, const std::string& caller)
119 {
120  return m_monSvc->startAud (evt=="Callback" ? "cbk" : evt, caller);
121 }
122 
123 void PerfMonAuditor::after(CustomEventTypeRef evt, const std::string& caller,
124  const StatusCode&)
125 {
126  return m_monSvc->stopAud (evt=="Callback" ? "cbk" : evt, caller);
127 }
128 
129 
Athena::PerfMonAuditor::m_monSvc
PerfMonSvc_t m_monSvc
Pointer to the IPerfMonSvc.
Definition: PerfMonAuditor.h:92
Athena::PerfMonAuditor::afterReinitialize
virtual void afterReinitialize(INamedInterface *alg)
Definition: PerfMonAuditor.cxx:91
Athena::PerfMonAuditor::afterExecute
virtual void afterExecute(INamedInterface *alg, const StatusCode &)
Definition: PerfMonAuditor.cxx:102
Athena::PerfMonAuditor::PerfMonAuditor
PerfMonAuditor(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: PerfMonAuditor.cxx:35
Athena::PerfMonAuditor::beforeInitialize
virtual void beforeInitialize(INamedInterface *alg)
Definition: PerfMonAuditor.cxx:75
Athena::PerfMonAuditor::~PerfMonAuditor
virtual ~PerfMonAuditor()
Destructor.
Definition: PerfMonAuditor.cxx:51
PerfMonAuditor.h
Athena::PerfMonAuditor::beforeReinitialize
virtual void beforeReinitialize(INamedInterface *alg)
Definition: PerfMonAuditor.cxx:85
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
Athena::PerfMonAuditor::initialize
virtual StatusCode initialize()
Gaudi hooks.
Definition: PerfMonAuditor.cxx:56
PerfMon::State
Common definitions for the PerfMon packages.
Definition: PerfMonDefs.h:27
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
Athena
Some weak symbol referencing magic...
Definition: AthLegacySequence.h:21
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Athena::PerfMonAuditor::afterFinalize
virtual void afterFinalize(INamedInterface *alg)
Definition: PerfMonAuditor.cxx:113
IPerfMonSvc.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Athena::PerfMonAuditor::after
virtual void after(IAuditor::CustomEventTypeRef evt, INamedInterface *caller, const StatusCode &sc)
Audit the end of a custom "event".
Definition: PerfMonAuditor.h:73
Athena::PerfMonAuditor::beforeExecute
virtual void beforeExecute(INamedInterface *alg)
Definition: PerfMonAuditor.cxx:97
compute_lumi.fin
fin
Definition: compute_lumi.py:19
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Athena::PerfMonAuditor::beforeFinalize
virtual void beforeFinalize(INamedInterface *alg)
Definition: PerfMonAuditor.cxx:108
Athena::PerfMonAuditor::before
virtual void before(IAuditor::CustomEventTypeRef evt, INamedInterface *caller)
Audit the start of a custom "event".
Definition: PerfMonAuditor.h:61
Athena::PerfMonAuditor::afterInitialize
virtual void afterInitialize(INamedInterface *alg)
Definition: PerfMonAuditor.cxx:80