| The Gaudi Framework v32r1 (f65d50dc)

StalledEventMonitor.h
Go to the documentation of this file.
1 /*
2 * StalledEventMonitor.h
3 *
4 * Created on: Apr 19, 2010
5 * Author: Marco Clemencic
6 */
7
8 #ifndef STALLEDEVENTMONITOR_H_
9 #define STALLEDEVENTMONITOR_H_
10
11 // Include files
12 #include "GaudiKernel/IIncidentListener.h"
13 #include "GaudiKernel/Service.h"
14 #include <memory>
15
16 // Forward declarations
17 class WatchdogThread;
18 class IIncidentSvc;
19
29 class StalledEventMonitor : public extends<Service, IIncidentListener> {
30 public:
32 using extends::extends;
33
36 StatusCode initialize() override;
37
39 StatusCode start() override;
40
42 void handle( const Incident& /* incident */ ) override;
43
45 StatusCode stop() override;
46
48 StatusCode finalize() override;
49
50 private:
51 Gaudi::Property<unsigned int> m_eventTimeout{
52 this, "EventTimeout", 600, "Number of seconds allowed to process a single event (0 to disable the check)."};
53 Gaudi::Property<int> m_maxTimeoutCount{this, "MaxTimeoutCount", 0,
54 "Number timeouts before aborting the execution (0 means never abort)."};
55 Gaudi::Property<bool> m_stackTrace{this, "StackTrace", false, "Whether to print the stack-trace on timeout."};
56
58 std::unique_ptr<WatchdogThread> m_watchdog;
59
61 SmartIF<IIncidentSvc> m_incidentSvc;
62 };
63
64 #endif // STALLEDEVENTMONITOR_H_
SmartIF< IIncidentSvc >
StalledEventMonitor::stop
StatusCode stop() override
Stop the watchdog thread (after the event loop).
Definition: StalledEventMonitor.cpp:120
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
StalledEventMonitor::m_eventTimeout
Gaudi::Property< unsigned int > m_eventTimeout
Definition: StalledEventMonitor.h:51
StalledEventMonitor::m_watchdog
std::unique_ptr< WatchdogThread > m_watchdog
Pointer to the watchdog thread that checks for the event timeout.
Definition: StalledEventMonitor.h:58
StalledEventMonitor::handle
void handle(const Incident &) override
Notify the watchdog thread for a new event.
Definition: StalledEventMonitor.cpp:115
StalledEventMonitor::m_stackTrace
Gaudi::Property< bool > m_stackTrace
Definition: StalledEventMonitor.h:55
StalledEventMonitor::start
StatusCode start() override
Start the watchdog thread (before entering the event loop).
Definition: StalledEventMonitor.cpp:109
Service.h
StalledEventMonitor
Service that monitor the time taken by processing of single events using a separate thread.
Definition: StalledEventMonitor.h:29
StalledEventMonitor::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to the incident service.
Definition: StalledEventMonitor.h:61
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StalledEventMonitor::initialize
StatusCode initialize() override
Initialization of the service.
Definition: StalledEventMonitor.cpp:82
std::unique_ptr< WatchdogThread >
WatchdogThread
Simple class for asynchronous check of time-out.
Definition: WatchdogThread.h:27
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
Incident
Base class for all Incidents (computing events).
Definition: Incident.h:17
IIncidentListener.h
StalledEventMonitor::finalize
StatusCode finalize() override
Finalization of the service.
Definition: StalledEventMonitor.cpp:126
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23
StalledEventMonitor::m_maxTimeoutCount
Gaudi::Property< int > m_maxTimeoutCount
Definition: StalledEventMonitor.h:53