The Gaudi Framework  v33r0 (d5ea422b)
StalledEventMonitor.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 /*
12  * StalledEventMonitor.h
13  *
14  * Created on: Apr 19, 2010
15  * Author: Marco Clemencic
16  */
17 
18 #ifndef STALLEDEVENTMONITOR_H_
19 #define STALLEDEVENTMONITOR_H_
20 
21 // Include files
23 #include "GaudiKernel/Service.h"
24 #include <memory>
25 
26 // Forward declarations
27 class WatchdogThread;
28 class IIncidentSvc;
29 
39 class StalledEventMonitor : public extends<Service, IIncidentListener> {
40 public:
42  using extends::extends;
43 
46  StatusCode initialize() override;
47 
49  StatusCode start() override;
50 
52  void handle( const Incident& /* incident */ ) override;
53 
55  StatusCode stop() override;
56 
58  StatusCode finalize() override;
59 
60 private:
62  this, "EventTimeout", 600, "Number of seconds allowed to process a single event (0 to disable the check)."};
63  Gaudi::Property<int> m_maxTimeoutCount{this, "MaxTimeoutCount", 0,
64  "Number timeouts before aborting the execution (0 means never abort)."};
65  Gaudi::Property<bool> m_stackTrace{this, "StackTrace", false, "Whether to print the stack-trace on timeout."};
66 
69 
72 };
73 
74 #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:370
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:61
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:20
Base class for all Incidents (computing events).
Definition: Incident.h:27
StatusCode finalize() override
Finalization of the service.
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:33
Gaudi::Property< int > m_maxTimeoutCount