| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 {
31 public:
33 StalledEventMonitor( const std::string& name, ISvcLocator* svcLoc );
34
36 ~StalledEventMonitor() override = default;
37
40 StatusCode initialize() override;
41
43 StatusCode start() override;
44
46 void handle( const Incident& /* incident */ ) override;
47
49 StatusCode stop() override;
50
52 StatusCode finalize() override;
53
54 private:
55 Gaudi::Property<unsigned int> m_eventTimeout{
56 this, "EventTimeout", 600, "Number of seconds allowed to process a single event (0 to disable the check)."};
57 Gaudi::Property<int> m_maxTimeoutCount{this, "MaxTimeoutCount", 0,
58 "Number timeouts before aborting the execution (0 means never abort)."};
59 Gaudi::Property<bool> m_stackTrace{this, "StackTrace", false, "Whether to print the stack-trace on timeout."};
60
62 std::unique_ptr<WatchdogThread> m_watchdog;
63
65 SmartIF<IIncidentSvc> m_incidentSvc;
66 };
67
68 #endif // STALLEDEVENTMONITOR_H_
SmartIF< IIncidentSvc >
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
StalledEventMonitor::stop
StatusCode stop() override
Stop the watchdog thread (after the event loop).
Definition: StalledEventMonitor.cpp:128
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
StalledEventMonitor::m_eventTimeout
Gaudi::Property< unsigned int > m_eventTimeout
Definition: StalledEventMonitor.h:55
StalledEventMonitor::m_watchdog
std::unique_ptr< WatchdogThread > m_watchdog
Pointer to the watchdog thread that checks for the event timeout.
Definition: StalledEventMonitor.h:62
StalledEventMonitor::handle
void handle(const Incident &) override
Notify the watchdog thread for a new event.
Definition: StalledEventMonitor.cpp:122
StalledEventMonitor::m_stackTrace
Gaudi::Property< bool > m_stackTrace
Definition: StalledEventMonitor.h:59
StalledEventMonitor::~StalledEventMonitor
~StalledEventMonitor() override=default
Destructor.
StalledEventMonitor::start
StatusCode start() override
Start the watchdog thread (before entering the event loop).
Definition: StalledEventMonitor.cpp:115
std::string
STL class.
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:65
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
StalledEventMonitor::StalledEventMonitor
StalledEventMonitor(const std::string &name, ISvcLocator *svcLoc)
Constructor.
Definition: StalledEventMonitor.cpp:85
StalledEventMonitor::initialize
StatusCode initialize() override
Initialization of the service.
Definition: StalledEventMonitor.cpp:88
std::unique_ptr< WatchdogThread >
WatchdogThread
Simple class for asynchronous check of time-out.
Definition: WatchdogThread.h:28
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:135
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23
StalledEventMonitor::m_maxTimeoutCount
Gaudi::Property< int > m_maxTimeoutCount
Definition: StalledEventMonitor.h:57