The Gaudi Framework  v30r3 (a5ef0a68)
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
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 {
31 public:
33  using extends::extends;
34 
37  StatusCode initialize() override;
38 
40  StatusCode start() override;
41 
43  void handle( const Incident& /* incident */ ) override;
44 
46  StatusCode stop() override;
47 
49  StatusCode finalize() override;
50 
51 private:
53  this, "EventTimeout", 600, "Number of seconds allowed to process a single event (0 to disable the check)."};
54  Gaudi::Property<int> m_maxTimeoutCount{this, "MaxTimeoutCount", 0,
55  "Number timeouts before aborting the execution (0 means never abort)."};
56  Gaudi::Property<bool> m_stackTrace{this, "StackTrace", false, "Whether to print the stack-trace on timeout."};
57 
60 
63 };
64 
65 #endif // STALLEDEVENTMONITOR_H_
StatusCode stop() override
Stop the watchdog thread (after the event loop).
Implementation of property with value of concrete type.
Definition: Property.h:381
Gaudi::Property< unsigned int > m_eventTimeout
std::unique_ptr< WatchdogThread > m_watchdog
Pointer to the watchdog thread that checks for the event timeout.
void handle(const Incident &) override
Notify the watchdog thread for a new event.
Gaudi::Property< bool > m_stackTrace
StatusCode start() override
Start the watchdog thread (before entering the event loop).
Service that monitor the time taken by processing of single events using a separate thread...
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to the incident service.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
StatusCode initialize() override
Initialization of the service.
Simple class for asynchronous check of time-out.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
Base class for all Incidents (computing events).
Definition: Incident.h:17
StatusCode finalize() override
Finalization of the service.
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23
Gaudi::Property< int > m_maxTimeoutCount