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/Service.h"
13 #include "GaudiKernel/IIncidentListener.h"
14 #include <memory>
15 
16 // Forward declarations
17 class WatchdogThread;
18 class IIncidentSvc;
19 
29 class StalledEventMonitor: public extends1<Service, IIncidentListener> {
30 public:
32  StalledEventMonitor(const std::string& name, ISvcLocator* svcLoc);
33 
35  ~StalledEventMonitor() override = default;
36 
39  StatusCode initialize() override;
40 
42  StatusCode start() override;
43 
45  void handle(const Incident& /* incident */) override;
46 
48  StatusCode stop() override;
49 
51  StatusCode finalize() override;
52 
53 private:
55  unsigned int m_eventTimeout;
56 
59 
62 
64  std::unique_ptr<WatchdogThread> m_watchdog;
65 
68 
69 };
70 
71 #endif // STALLEDEVENTMONITOR_H_
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
StatusCode stop() override
Stop the watchdog thread (after the event loop).
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.
~StalledEventMonitor() override=default
Destructor.
bool m_stackTrace
Whether to print a stack-trace on timeout.
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:26
int m_maxTimeoutCount
Number timeouts before aborting the execution (0 means never abort).
unsigned int m_eventTimeout
Number of seconds allowed to process a single event.
StalledEventMonitor(const std::string &name, ISvcLocator *svcLoc)
Constructor.
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:16
StatusCode finalize() override
Finalization of the service.
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:21