All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TimingAuditor Class Reference

Simple auditor which uses SequencerTimerTool for ALL algorithms, including the algorithm from main Gaudi "TopAlg" list and algorithms managed by Data-On-Demand Service. More...

Inheritance diagram for TimingAuditor:
Collaboration diagram for TimingAuditor:

Public Member Functions

virtual void before (StandardEventType evt, INamedInterface *alg)
 The following methods are meant to be implemented by the child class... More...
 
virtual void after (StandardEventType evt, INamedInterface *alg, const StatusCode &sc)
 Audit the end of a standard "event". More...
 
virtual void before (CustomEventTypeRef evt, const std::string &name)
 Audit the start of a custom "event" for callers that do not implement INamedInterface. More...
 
virtual void after (CustomEventTypeRef evt, const std::string &name, const StatusCode &sc)
 Audit the end of a custom "event" for callers that do not implement INamedInterface. More...
 
virtual void handle (const Incident &)
 Inform that a new incident has occurred. More...
 
virtual StatusCode initialize ()
 factory: More...
 
virtual StatusCode finalize ()
 
 TimingAuditor (const std::string &name, ISvcLocator *pSvc)
 standard constructor More...
 
virtual ~TimingAuditor ()
 virtual destructor More...
 
- Public Member Functions inherited from extends1< Auditor, IIncidentListener >
 extends1 (A1 a1, A2 a2, A3 a3)
 Templated constructor with 3 arguments. More...
 
 extends1 (A1 a1, A2 a2)
 Templated constructor with 2 arguments. More...
 
 extends1 (A1 a1)
 Templated constructor with 1 argument. More...
 
 extends1 ()
 Default constructor. More...
 
virtual void * i_cast (const InterfaceID &tid) const
 Implementation of IInterface::i_cast. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)
 Implementation of IInterface::queryInterface. More...
 
virtual std::vector< std::string > getInterfaceNames () const
 Implementation of IInterface::getInterfaceNames. More...
 
virtual ~extends1 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from Auditor
 Auditor (const std::string &name, ISvcLocator *svcloc)
 Constructor. More...
 
virtual ~Auditor ()
 Destructor. More...
 
StatusCode sysInitialize ()
 Initialization method invoked by the framework. More...
 
StatusCode sysFinalize ()
 Finalization method invoked by the framework. More...
 
virtual void before (StandardEventType, const std::string &)
 Audit the start of a standard "event" for callers that do not implement INamedInterface. More...
 
virtual void before (CustomEventTypeRef, INamedInterface *)
 Audit the start of a custom "event". More...
 
virtual void after (StandardEventType, const std::string &, const StatusCode &)
 Audit the end of a standard "event" for callers that do not implement INamedInterface. More...
 
virtual void after (CustomEventTypeRef, INamedInterface *, const StatusCode &)
 Audit the end of a custom "event". More...
 
virtual void beforeInitialize (INamedInterface *)
 
virtual void afterInitialize (INamedInterface *)
 
virtual void beforeReinitialize (INamedInterface *)
 
virtual void afterReinitialize (INamedInterface *)
 
virtual void beforeExecute (INamedInterface *)
 
virtual void afterExecute (INamedInterface *, const StatusCode &)
 
virtual void beforeFinalize (INamedInterface *)
 
virtual void afterFinalize (INamedInterface *)
 
virtual void beforeBeginRun (INamedInterface *)
 
virtual void afterBeginRun (INamedInterface *)
 
virtual void beforeEndRun (INamedInterface *)
 
virtual void afterEndRun (INamedInterface *)
 
virtual const std::string & name () const
 Retrieve the name of the instance. More...
 
virtual bool isEnabled () const
 Tell if the auditor is enabled or not. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
int outputLevel () const
 Retrieve the output level of current auditor. More...
 
void setOutputLevel (int level)
 Set the output level for current auditor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const
 The standard service locator. More...
 
template<class T >
StatusCode service (const std::string &name, T *&svc, bool createIf=false) const
 Access a service by name, creating it if it doesn't already exist. More...
 
virtual StatusCode setProperty (const Property &p)
 Set a value of a property of an auditor. More...
 
virtual StatusCode setProperty (const std::string &s)
 Implementation of IProperty::setProperty. More...
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Implementation of IProperty::setProperty. More...
 
virtual StatusCode getProperty (Property *p) const
 Get the value of a property. More...
 
virtual const PropertygetProperty (const std::string &name) const
 Get the property by name. More...
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Implementation of IProperty::getProperty. More...
 
const std::vector< Property * > & getProperties () const
 Get all properties. More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
StatusCode setProperties ()
 Set the auditor's properties. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
- Public Member Functions inherited from extend_interfaces2< IAuditor, IProperty >
virtual ~extend_interfaces2 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IAuditor
 DeclareInterfaceID (IAuditor, 3, 0)
 InterfaceID. More...
 
- Public Member Functions inherited from INamedInterface
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes). More...
 
- Public Member Functions inherited from IInterface
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long release ()=0
 Release Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IProperty
 DeclareInterfaceID (IProperty, 2, 0)
 InterfaceID. More...
 
- Public Member Functions inherited from extend_interfaces1< IIncidentListener >
virtual ~extend_interfaces1 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IIncidentListener
 DeclareInterfaceID (IIncidentListener, 2, 0)
 InterfaceID. More...
 

Private Types

typedef GaudiUtils::VectorMap
< const INamedInterface *, int > 
Map
 
typedef GaudiUtils::HashMap
< std::string, int > 
MapUser
 

Private Member Functions

void i_beforeInitialize (INamedInterface *alg)
 
void i_afterInitialize (INamedInterface *alg)
 
void i_beforeFinalize (INamedInterface *alg)
 
void i_beforeExecute (INamedInterface *alg)
 
void i_afterExecute (INamedInterface *alg)
 
 TimingAuditor ()
 
 TimingAuditor (const TimingAuditor &)
 
TimingAuditoroperator= (const TimingAuditor &)
 

Private Attributes

IToolSvcm_toolSvc
 tool service More...
 
IIncidentSvcm_incSvc
 incident service More...
 
ISequencerTimerToolm_timer
 the timer tool More...
 
INamedInterfacem_appMgr
 ApplicationManager. More...
 
Map m_map
 
int m_indent
 indentation level More...
 
bool m_inEvent
 "In event" flag More...
 
bool m_goodForDOD
 "optimized for DOD" More...
 
MapUser m_mapUser
 map used to record user timing events More...
 
bool m_histoSaved
 

Additional Inherited Members

- Public Types inherited from extends1< Auditor, IIncidentListener >
typedef extends1 base_class
 Typedef to this class. More...
 
typedef extend_interfaces1
< IIncidentListener
extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from Auditor
typedef
Gaudi::PluginService::Factory2
< IAuditor *, const
std::string &, ISvcLocator * > 
Factory
 
- Public Types inherited from implements2< IAuditor, IProperty >
typedef implements2 base_class
 Typedef to this class. More...
 
typedef extend_interfaces2
< IAuditor, IProperty
extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from extend_interfaces2< IAuditor, IProperty >
typedef mpl::fold< typename
IAuditor::iid::iids::type,
typename
IProperty::iid::iids::type,
mpl::insert< mpl::_1, mpl::_2 >
>::type 
ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IAuditor
enum  StandardEventType {
  Initialize, ReInitialize, Execute, BeginRun,
  EndRun, Finalize, Start, Stop,
  ReStart
}
 Defines the standard (= used by the framework) auditable event types. More...
 
typedef std::string CustomEventType
 Type used to allow users to specify a custom event to be audit. More...
 
typedef const CustomEventTypeCustomEventTypeRef
 Used in function calls for optimization purposes. More...
 
- Public Types inherited from IInterface
enum  Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR }
 Return status. More...
 
typedef Gaudi::InterfaceId
< IInterface, 0, 0 > 
iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
- Public Types inherited from extend_interfaces1< IIncidentListener >
typedef
IIncidentListener::iid::iids::type 
ext_iids
 MPL set of interfaces extended by this one. More...
 
- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 

Detailed Description

Simple auditor which uses SequencerTimerTool for ALL algorithms, including the algorithm from main Gaudi "TopAlg" list and algorithms managed by Data-On-Demand Service.

Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-01-31

Definition at line 28 of file TimingAuditor.cpp.

Member Typedef Documentation

Definition at line 96 of file TimingAuditor.cpp.

typedef GaudiUtils::HashMap<std::string,int> TimingAuditor::MapUser
private

Definition at line 105 of file TimingAuditor.cpp.

Constructor & Destructor Documentation

TimingAuditor::TimingAuditor ( const std::string &  name,
ISvcLocator pSvc 
)
inline

standard constructor

Definition at line 57 of file TimingAuditor.cpp.

59  : base_class ( name , pSvc )
60  //
61  , m_toolSvc ( 0 )
62  , m_incSvc ( 0 )
63  //
64  , m_timer ( 0 )
65  //
66  , m_appMgr ( 0 )
67  //
68  , m_map ( )
69  , m_indent ( 0 )
70  , m_inEvent ( false )
71  , m_goodForDOD ( false )
72  , m_mapUser ( )
73  , m_histoSaved ( false )
74  {
75  declareProperty ( "OptimizedForDOD" , m_goodForDOD ) ;
76  } ;
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:218
IToolSvc * m_toolSvc
tool service
bool m_inEvent
"In event" flag
extends1 base_class
Typedef to this class.
Definition: extends.h:12
int m_indent
indentation level
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Auditor.h:233
IIncidentSvc * m_incSvc
incident service
MapUser m_mapUser
map used to record user timing events
INamedInterface * m_appMgr
ApplicationManager.
ISequencerTimerTool * m_timer
the timer tool
bool m_goodForDOD
"optimized for DOD"
virtual TimingAuditor::~TimingAuditor ( )
inlinevirtual

virtual destructor

Definition at line 78 of file TimingAuditor.cpp.

78 {}
TimingAuditor::TimingAuditor ( )
private
TimingAuditor::TimingAuditor ( const TimingAuditor )
private

Member Function Documentation

void TimingAuditor::after ( StandardEventType  ,
INamedInterface ,
const StatusCode sc 
)
virtual

Audit the end of a standard "event".

Reimplemented from Auditor.

Definition at line 215 of file TimingAuditor.cpp.

216 {
217  switch (evt) {
218  case IAuditor::Initialize : i_afterInitialize( alg ); break;
219  case IAuditor::Execute : i_afterExecute( alg ); break;
220  default: break;
221  }
222 }
void i_afterInitialize(INamedInterface *alg)
void i_afterExecute(INamedInterface *alg)
void TimingAuditor::after ( CustomEventTypeRef  ,
const std::string &  ,
const StatusCode sc 
)
virtual

Audit the end of a custom "event" for callers that do not implement INamedInterface.

Reimplemented from Auditor.

Definition at line 321 of file TimingAuditor.cpp.

322 {
323  // Ignore obvious mistakes
324  if ( name.empty() && evt.empty() ) { return; }
325 
326  // look for the user timer in the map
327  std::string nick = name + ":" + evt;
328  MapUser::iterator found = m_mapUser.find( nick );
329 
330  // We cannot do much if the timer is not available
331  if ( m_mapUser.end() == found ) {
332  MsgStream log(msgSvc(), this->name());
333  log << MSG::WARNING << "Trying to stop the measure of the timing for '"
334  << nick << "' but it was never started. Check the code"
335  << endmsg;
336  return;
337  }
338  m_timer->stop( found->second );
339 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:218
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Auditor.cpp:226
iterator end()
Definition: Map.h:131
iterator find(const key_type &key)
Definition: Map.h:148
MapUser m_mapUser
map used to record user timing events
map_type::iterator iterator
Definition: Map.h:98
ISequencerTimerTool * m_timer
the timer tool
virtual double stop(int index)=0
stop the counter, return the elapsed time
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:243
void TimingAuditor::before ( StandardEventType  evt,
INamedInterface obj 
)
virtual

The following methods are meant to be implemented by the child class...

Reimplemented from Auditor.

Definition at line 205 of file TimingAuditor.cpp.

206 {
207  switch (evt) {
208  case IAuditor::Initialize : i_beforeInitialize( alg ); break;
209  case IAuditor::Execute : i_beforeExecute( alg ); break;
210  case IAuditor::Finalize : i_beforeFinalize( alg ); break;
211  default: break;
212  }
213 }
void i_beforeInitialize(INamedInterface *alg)
void i_beforeExecute(INamedInterface *alg)
void i_beforeFinalize(INamedInterface *alg)
void TimingAuditor::before ( CustomEventTypeRef  ,
const std::string &   
)
virtual

Audit the start of a custom "event" for callers that do not implement INamedInterface.

Reimplemented from Auditor.

Definition at line 299 of file TimingAuditor.cpp.

300 {
301  // Ignore obvious mistakes
302  if ( name.empty() && evt.empty() ) { return; }
303 
304  // look for the user timer in the map
305  int timer = 0;
306  std::string nick = name + ":" + evt;
307  MapUser::iterator found = m_mapUser.find( nick );
308 
309  if ( m_mapUser.end() == found ) {
310  // add a new timer if not yet available
311  timer = m_timer->addTimer( nick ) ;
312  m_mapUser[nick] = timer;
313  }
314  else {
315  timer = found->second;
316  }
317 
318  m_timer->start( timer );
319 }
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:218
virtual int addTimer(const std::string &name)=0
add a timer entry with the specified name
iterator end()
Definition: Map.h:131
iterator find(const key_type &key)
Definition: Map.h:148
MapUser m_mapUser
map used to record user timing events
virtual void start(int index)=0
start the counter, i.e.
map_type::iterator iterator
Definition: Map.h:98
ISequencerTimerTool * m_timer
the timer tool
StatusCode TimingAuditor::finalize ( )
virtual

Reimplemented from Auditor.

Definition at line 179 of file TimingAuditor.cpp.

180 {
181  if ( 0 != m_incSvc )
182  {
183  m_incSvc -> removeListener ( this , IncidentType::BeginEvent ) ;
184  m_incSvc -> removeListener ( this , IncidentType::EndEvent ) ;
185  m_incSvc -> release () ;
186  m_incSvc = 0 ;
187  }
188  if ( 0 != m_toolSvc )
189  {
190  // the 2 following line are commented out: it is
191  // is a temporary hack which prevent a crash due to a problem in
192  // the reference counting
193  // if ( 0 != m_timer )
194  // { m_toolSvc -> releaseTool ( m_timer ) . ignore() ; m_timer = 0 ; }
195  m_toolSvc -> release () ;
196  m_toolSvc = 0 ;
197  }
198  if ( 0 != m_appMgr ) { m_appMgr -> release () ; m_appMgr = 0 ; }
199  // clear the map
200  m_map.clear() ;
201  // finalize the base class
202  return Auditor::finalize () ;
203 }
const std::string BeginEvent
Processing of a new event has started.
Definition: Incident.h:60
virtual StatusCode finalize()
Definition: Auditor.cpp:213
IToolSvc * m_toolSvc
tool service
const std::string EndEvent
Processing of the last event has finished.
Definition: Incident.h:61
IIncidentSvc * m_incSvc
incident service
INamedInterface * m_appMgr
ApplicationManager.
virtual unsigned long release()=0
Release Interface instance.
void clear()
clear the container
Definition: VectorMap.h:499
void TimingAuditor::handle ( const Incident i)
virtual

Inform that a new incident has occurred.

Implements IIncidentListener.

Definition at line 341 of file TimingAuditor.cpp.

342 {
343  if ( IncidentType::BeginEvent == i.type () )
344  {
345  m_timer -> start ( m_map[ m_appMgr ] ) ;
346  ++m_indent ;
347  m_inEvent = true ;
348  }
349  else if ( IncidentType::EndEvent == i.type () )
350  {
351  m_timer -> stop ( m_map[ m_appMgr ] ) ;
352  --m_indent ;
353  m_inEvent = false ;
354  }
355 }
const std::string BeginEvent
Processing of a new event has started.
Definition: Incident.h:60
const std::string & type() const
Access to the incident type.
Definition: Incident.h:34
bool m_inEvent
"In event" flag
int m_indent
indentation level
const std::string EndEvent
Processing of the last event has finished.
Definition: Incident.h:61
INamedInterface * m_appMgr
ApplicationManager.
ISequencerTimerTool * m_timer
the timer tool
tuple start
Definition: IOTest.py:88
void TimingAuditor::i_afterExecute ( INamedInterface alg)
private

Definition at line 290 of file TimingAuditor.cpp.

291 {
292  if ( 0 == alg ) { return ; }
293  Map::iterator found = m_map.find( alg ) ;
294  if ( m_map.end() == found ) { return ; }
295  m_timer->stop( found->second ) ;
296  --m_indent ;
297 }
_vector::const_iterator iterator
visible const_iterator (exported)
Definition: VectorMap.h:149
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:457
int m_indent
indentation level
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:200
ISequencerTimerTool * m_timer
the timer tool
virtual double stop(int index)=0
stop the counter, return the elapsed time
void TimingAuditor::i_afterInitialize ( INamedInterface alg)
private

Definition at line 259 of file TimingAuditor.cpp.

260 {
261  if ( m_goodForDOD ) { return ; }
262  if ( 0 == alg ) { return ; }
263  --m_indent ;
264 }
int m_indent
indentation level
bool m_goodForDOD
"optimized for DOD"
void TimingAuditor::i_beforeExecute ( INamedInterface alg)
private

Definition at line 266 of file TimingAuditor.cpp.

267 {
268  if ( 0 == alg ) { return ; }
269  ++m_indent ;
270  Map::iterator found = m_map.find( alg ) ;
271  if ( m_map.end() == found )
272  {
273  MsgStream log( msgSvc() , name() ) ;
274  log << MSG::DEBUG
275  << "Insert non-structural component '"
276  << alg->name() << "' of type '"
277  << System::typeinfoName(typeid(*alg)) << "' at level "
278  << m_indent << endmsg ;
279  std::string nick = alg->name() ;
280  if ( 0 < m_indent ) { nick = std::string ( m_indent , ' ') + nick ; }
281  if ( !m_goodForDOD ) { nick[0]='*' ;}
282  int timer = m_timer->addTimer( nick ) ;
283  m_map.insert ( alg , timer ) ;
284  m_timer->start( timer ) ;
285  return ;
286  }
287  m_timer->start( found->second ) ;
288 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:218
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Auditor.cpp:226
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
virtual int addTimer(const std::string &name)=0
add a timer entry with the specified name
_vector::const_iterator iterator
visible const_iterator (exported)
Definition: VectorMap.h:149
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:319
virtual const std::string & name() const =0
Retrieve the name of the instance.
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:457
int m_indent
indentation level
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:200
virtual void start(int index)=0
start the counter, i.e.
ISequencerTimerTool * m_timer
the timer tool
bool m_goodForDOD
"optimized for DOD"
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:243
void TimingAuditor::i_beforeFinalize ( INamedInterface alg)
private

Definition at line 224 of file TimingAuditor.cpp.

225 {
226  if (!m_histoSaved)
227  {
229  m_histoSaved = true;
230  }
231 }
virtual void saveHistograms()=0
prepares and saves the timing histograms
ISequencerTimerTool * m_timer
the timer tool
void TimingAuditor::i_beforeInitialize ( INamedInterface alg)
private

Definition at line 234 of file TimingAuditor.cpp.

235 {
236  if ( m_goodForDOD ) { return ; }
237  //
238  if ( 0 == alg ) { return ; }
239  Map::iterator found = m_map.find( alg ) ;
240  if ( m_map.end() != found ) { return ; }
241  ++m_indent ;
242  std::string nick = alg->name() ;
243  if ( 0 < m_indent ) { nick = std::string ( m_indent , ' ') + nick ; }
244  if ( m_inEvent )
245  {
246  nick[0] = '*' ;
247  MsgStream log( msgSvc() , name() ) ;
248  log << MSG::DEBUG
249  << "Insert non-structural component '"
250  << alg->name() << "' of type '"
251  << System::typeinfoName(typeid(*alg)) << "' at level "
252  << m_indent << endmsg ;
253  }
254  int timer = m_timer->addTimer( nick ) ;
255  m_map.insert ( alg , timer ) ;
256  m_timer->start( timer ) ;
257 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:218
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Auditor.cpp:226
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
virtual int addTimer(const std::string &name)=0
add a timer entry with the specified name
bool m_inEvent
"In event" flag
_vector::const_iterator iterator
visible const_iterator (exported)
Definition: VectorMap.h:149
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:319
virtual const std::string & name() const =0
Retrieve the name of the instance.
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:457
int m_indent
indentation level
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:200
virtual void start(int index)=0
start the counter, i.e.
ISequencerTimerTool * m_timer
the timer tool
bool m_goodForDOD
"optimized for DOD"
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:243
StatusCode TimingAuditor::initialize ( )
virtual

factory:

Reimplemented from Auditor.

Definition at line 118 of file TimingAuditor.cpp.

119 {
121  if ( sc.isFailure() ) { return sc ; } // RETURN
122 
123  MsgStream log ( msgSvc() , name() ) ;
124 
125  // get tool service
126  if ( 0 == m_toolSvc )
127  {
128  sc = Auditor::service ( "ToolSvc" , m_toolSvc ) ;
129  if ( sc.isFailure() )
130  {
131  log << "Could not retrieve 'ToolSvc' " << sc << endmsg ;
132  return sc ; // RETURN
133  }
134  if ( 0 == m_timer )
135  {
136  sc = m_toolSvc->retrieveTool
137  ( "SequencerTimerTool/TIMER" , m_timer , this , true ) ;
138  if ( sc.isFailure() )
139  {
140  log << MSG::ERROR
141  << "Could not retrieve ISequencerTimerTool" << endmsg ;
142  return sc ;
143  }
144  }
145  }
146  // get incident service
147  if ( 0 == m_incSvc )
148  {
149  sc = Auditor::service ( "IncidentSvc" , m_incSvc ) ;
150  if ( sc.isFailure() )
151  {
152  log << MSG::ERROR
153  << "Could not retrieve 'IncidentSvc'" << sc << endmsg ;
154  return sc ;
155  }
156  m_incSvc -> addListener ( this , IncidentType::BeginEvent ) ;
157  m_incSvc -> addListener ( this , IncidentType::EndEvent ) ;
158  }
159  // get the application manager
160  if ( 0 == m_appMgr )
161  {
162  sc = Auditor::service ( "ApplicationMgr" , m_appMgr ) ;
163  if ( sc.isFailure() )
164  {
165  log << MSG::ERROR
166  << "Could not retrieve 'ApplicationMgr'" << sc << endmsg ;
167  return sc ;
168  }
169  if ( m_map.end() == m_map.find( m_appMgr ) )
170  {
171  int timer = m_timer->addTimer( "EVENT LOOP" ) ;
172  m_map.insert ( m_appMgr , timer ) ;
173  }
174  }
175  //
176  return StatusCode::SUCCESS ;
177 }
const std::string BeginEvent
Processing of a new event has started.
Definition: Incident.h:60
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode service(const std::string &name, T *&svc, bool createIf=false) const
Access a service by name, creating it if it doesn't already exist.
Definition: Auditor.h:117
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:218
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Auditor.cpp:226
IToolSvc * m_toolSvc
tool service
virtual int addTimer(const std::string &name)=0
add a timer entry with the specified name
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:319
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:72
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:457
const std::string EndEvent
Processing of the last event has finished.
Definition: Incident.h:61
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:200
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
IIncidentSvc * m_incSvc
incident service
INamedInterface * m_appMgr
ApplicationManager.
ISequencerTimerTool * m_timer
the timer tool
virtual StatusCode initialize()
Definition: Auditor.cpp:97
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:243
StatusCode retrieveTool(const std::string &type, T *&tool, const IInterface *parent=0, bool createIf=true)
Retrieve specified tool sub-type with tool dependent part of the name automatically assigned...
Definition: IToolSvc.h:133
TimingAuditor& TimingAuditor::operator= ( const TimingAuditor )
private

Member Data Documentation

INamedInterface* TimingAuditor::m_appMgr
private

ApplicationManager.

Definition at line 94 of file TimingAuditor.cpp.

bool TimingAuditor::m_goodForDOD
private

"optimized for DOD"

Definition at line 103 of file TimingAuditor.cpp.

bool TimingAuditor::m_histoSaved
private

Definition at line 109 of file TimingAuditor.cpp.

IIncidentSvc* TimingAuditor::m_incSvc
private

incident service

Definition at line 90 of file TimingAuditor.cpp.

int TimingAuditor::m_indent
private

indentation level

Definition at line 99 of file TimingAuditor.cpp.

bool TimingAuditor::m_inEvent
private

"In event" flag

Definition at line 101 of file TimingAuditor.cpp.

Map TimingAuditor::m_map
private

Definition at line 97 of file TimingAuditor.cpp.

MapUser TimingAuditor::m_mapUser
private

map used to record user timing events

Definition at line 106 of file TimingAuditor.cpp.

ISequencerTimerTool* TimingAuditor::m_timer
private

the timer tool

Definition at line 92 of file TimingAuditor.cpp.

IToolSvc* TimingAuditor::m_toolSvc
private

tool service

Definition at line 88 of file TimingAuditor.cpp.


The documentation for this class was generated from the following file: