Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
StalledEventMonitor Class Reference

Service that monitor the time taken by processing of single events using a separate thread. More...

#include <StalledEventMonitor.h>

Inheritance diagram for StalledEventMonitor:
Inheritance graph
[legend]
Collaboration diagram for StalledEventMonitor:
Collaboration graph
[legend]

Public Member Functions

 StalledEventMonitor (const std::string &name, ISvcLocator *svcLoc)
 Constructor.
 
virtual ~StalledEventMonitor ()
 Destructor.
 
virtual StatusCode initialize ()
 Initialization of the service.
 
virtual StatusCode start ()
 Start the watchdog thread (before entering the event loop).
 
virtual void handle (const Incident &)
 Notify the watchdog thread for a new event.
 
virtual StatusCode stop ()
 Stop the watchdog thread (after the event loop).
 
virtual StatusCode finalize ()
 Finalization of the service.
 
- Public Member Functions inherited from extends1< Service, IIncidentListener >
 extends1 (A1 a1, A2 a2, A3 a3)
 Templated constructor with 3 arguments.
 
 extends1 (A1 a1, A2 a2)
 Templated constructor with 2 arguments.
 
 extends1 (A1 a1)
 Templated constructor with 1 argument.
 
 extends1 ()
 Default constructor.
 
virtual void * i_cast (const InterfaceID &tid) const
 Implementation of IInterface::i_cast.
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)
 Implementation of IInterface::queryInterface.
 
virtual std::vector< std::stringgetInterfaceNames () const
 Implementation of IInterface::getInterfaceNames.
 
virtual ~extends1 ()
 Virtual destructor.
 
- Public Member Functions inherited from Service
virtual unsigned long release ()
 Release Interface instance.
 
virtual const std::stringname () const
 Retrieve name of the service.
 
virtual StatusCode configure ()
 
virtual StatusCode terminate ()
 
virtual Gaudi::StateMachine::State FSMState () const
 
virtual Gaudi::StateMachine::State targetFSMState () const
 
virtual StatusCode reinitialize ()
 
virtual StatusCode restart ()
 
virtual StatusCode sysInitialize ()
 Initialize Service.
 
virtual StatusCode sysStart ()
 Initialize Service.
 
virtual StatusCode sysStop ()
 Initialize Service.
 
virtual StatusCode sysFinalize ()
 Finalize Service.
 
virtual StatusCode sysReinitialize ()
 Re-initialize the Service.
 
virtual StatusCode sysRestart ()
 Re-initialize the Service.
 
virtual StatusCode setProperty (const Property &p)
 
virtual StatusCode setProperty (const std::string &s)
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 
virtual StatusCode getProperty (Property *p) const
 
virtual const PropertygetProperty (const std::string &name) const
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 
virtual const std::vector
< Property * > & 
getProperties () const
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
 Service (const std::string &name, ISvcLocator *svcloc)
 Standard Constructor.
 
SmartIF< ISvcLocator > & serviceLocator () const
 Retrieve pointer to service locator.
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified for the job.
 
template<class T >
StatusCode service (const std::string &name, const T *&psvc, bool createIf=true) const
 Access a service by name, creating it if it doesn't already exist.
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
 
template<class T >
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist.
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property.
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties.
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked.
 
- Public Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
 CommonMessaging (const A1 &a1, const A2 &a2, const A3 &a3)
 Templated constructor with 3 arguments.
 
 CommonMessaging (const A1 &a1, const A2 &a2)
 Templated constructor with 2 arguments.
 
 CommonMessaging (const A1 &a1)
 Templated constructor with 1 argument.
 
 CommonMessaging ()
 Default constructor.
 
virtual ~CommonMessaging ()
 Virtual destructor.
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service.
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream.
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts.
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS)
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL)
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING)
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO)
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG)
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE)
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO)
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream
 
- Public Member Functions inherited from extend_interfaces1< IIncidentListener >
virtual ~extend_interfaces1 ()
 Virtual destructor.
 
- Public Member Functions inherited from IIncidentListener
 DeclareInterfaceID (IIncidentListener, 2, 0)
 InterfaceID.
 
- Public Member Functions inherited from IInterface
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance.
 
virtual unsigned long release ()=0
 Release Interface instance.
 
virtual unsigned long refCount () const =0
 Current reference count.
 
virtual ~IInterface ()
 Virtual destructor.
 

Private Attributes

unsigned int m_eventTimeout
 Number of seconds allowed to process a single event.
 
int m_maxTimeoutCount
 Number timeouts before aborting the execution (0 means never abort).
 
bool m_stackTrace
 Whether to print a stack-trace on timeout.
 
std::auto_ptr< WatchdogThreadm_watchdog
 Pointer to the watchdog thread that checks for the event timeout.
 
SmartIF< IIncidentSvcm_incidentSvc
 Pointer to the incident service.
 

Additional Inherited Members

- Public Types inherited from extends1< Service, IIncidentListener >
typedef extends1 base_class
 Typedef to this class.
 
typedef extend_interfaces1
< IIncidentListener
extend_interfaces_base
 Typedef to the base of this class.
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces.
 
- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface.
 
- Protected Member Functions inherited from Service
virtual ~Service ()
 Standard Destructor.
 
int outputLevel () const
 get the Service's output level
 
- Protected Attributes inherited from Service
IntegerProperty m_outputLevel
 Service output level.
 
Gaudi::StateMachine::State m_state
 Service state.
 
Gaudi::StateMachine::State m_targetState
 Service state.
 

Detailed Description

Service that monitor the time taken by processing of single events using a separate thread.

See Also
WatchdogThread
Author
Marco Clemencic
Date
Apr 19, 2010

Definition at line 29 of file StalledEventMonitor.h.

Constructor & Destructor Documentation

StalledEventMonitor::StalledEventMonitor ( const std::string name,
ISvcLocator svcLoc 
)

Constructor.

Definition at line 85 of file StalledEventMonitor.cpp.

:
base_class(name, svcLoc) {
declareProperty("EventTimeout", m_eventTimeout = 600,
"Number of seconds allowed to process a single event (0 to disable the check).");
declareProperty("MaxTimeoutCount", m_maxTimeoutCount = 0,
"Number timeouts before aborting the execution (0 means never abort).");
declareProperty("StackTrace", m_stackTrace = false,
"Whether to print the stack-trace on timeout.");
}
StalledEventMonitor::~StalledEventMonitor ( )
virtual

Destructor.

Definition at line 99 of file StalledEventMonitor.cpp.

{
}

Member Function Documentation

StatusCode StalledEventMonitor::finalize ( )
virtual

Finalization of the service.

Reimplemented from Service.

Definition at line 153 of file StalledEventMonitor.cpp.

{
// destroy the watchdog thread (if any)
// unregistering from the IncidentSvc
m_incidentSvc->removeListener(this, IncidentType::BeginEvent);
return base_class::finalize();
}
void StalledEventMonitor::handle ( const Incident )
virtual

Notify the watchdog thread for a new event.

Implements IIncidentListener.

Definition at line 142 of file StalledEventMonitor.cpp.

{
if (m_watchdog.get()) m_watchdog->ping();
}
StatusCode StalledEventMonitor::initialize ( )
virtual

Initialization of the service.

Prepare the watchdog thread and configures it.

Reimplemented from Service.

Definition at line 104 of file StalledEventMonitor.cpp.

{
if (sc.isFailure()) return sc;
// create the watchdog thread
new EventWatchdog(msgSvc(),
"EventWatchdog",
boost::posix_time::seconds(m_eventTimeout),
// register to the incident service
std::string serviceName = "IncidentSvc";
m_incidentSvc = serviceLocator()->service(serviceName);
if ( ! m_incidentSvc ) {
error() << "Cannot retrieve " << serviceName << endmsg;
}
debug() << "Register to the IncidentSvc" << endmsg;
} else {
warning() << "StalledEventMonitor/" << name()
<< " instantiated with 0 time-out: no monitoring performed" << endmsg;
}
}
StatusCode StalledEventMonitor::start ( )
virtual

Start the watchdog thread (before entering the event loop).

Reimplemented from Service.

Definition at line 136 of file StalledEventMonitor.cpp.

{
if (m_watchdog.get()) m_watchdog->start();
}
StatusCode StalledEventMonitor::stop ( )
virtual

Stop the watchdog thread (after the event loop).

Reimplemented from Service.

Definition at line 147 of file StalledEventMonitor.cpp.

{
if (m_watchdog.get()) m_watchdog->stop();
}

Member Data Documentation

unsigned int StalledEventMonitor::m_eventTimeout
private

Number of seconds allowed to process a single event.

Definition at line 55 of file StalledEventMonitor.h.

SmartIF<IIncidentSvc> StalledEventMonitor::m_incidentSvc
private

Pointer to the incident service.

Definition at line 67 of file StalledEventMonitor.h.

int StalledEventMonitor::m_maxTimeoutCount
private

Number timeouts before aborting the execution (0 means never abort).

Definition at line 58 of file StalledEventMonitor.h.

bool StalledEventMonitor::m_stackTrace
private

Whether to print a stack-trace on timeout.

Definition at line 61 of file StalledEventMonitor.h.

std::auto_ptr<WatchdogThread> StalledEventMonitor::m_watchdog
private

Pointer to the watchdog thread that checks for the event timeout.

Definition at line 64 of file StalledEventMonitor.h.


The documentation for this class was generated from the following files:
Generated at Wed Dec 4 2013 14:33:19 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004