Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v38r1p1 (ae26267b)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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_
StalledEventMonitor
Service that monitor the time taken by processing of single events using a separate thread.
Definition: StalledEventMonitor.h:39
StalledEventMonitor::initialize
StatusCode initialize() override
Initialization of the service.
Definition: StalledEventMonitor.cpp:92
WatchdogThread
Definition: WatchdogThread.h:37
StatusCode
Definition: StatusCode.h:65
StalledEventMonitor::finalize
StatusCode finalize() override
Finalization of the service.
Definition: StalledEventMonitor.cpp:136
StalledEventMonitor::m_eventTimeout
Gaudi::Property< unsigned int > m_eventTimeout
Definition: StalledEventMonitor.h:61
SmartIF< IIncidentSvc >
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
StalledEventMonitor::m_maxTimeoutCount
Gaudi::Property< int > m_maxTimeoutCount
Definition: StalledEventMonitor.h:63
StalledEventMonitor::handle
void handle(const Incident &) override
Notify the watchdog thread for a new event.
Definition: StalledEventMonitor.cpp:125
Service.h
StalledEventMonitor::m_watchdog
std::unique_ptr< WatchdogThread > m_watchdog
Pointer to the watchdog thread that checks for the event timeout.
Definition: StalledEventMonitor.h:68
StalledEventMonitor::stop
StatusCode stop() override
Stop the watchdog thread (after the event loop).
Definition: StalledEventMonitor.cpp:130
IIncidentListener.h
StalledEventMonitor::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to the incident service.
Definition: StalledEventMonitor.h:71
StalledEventMonitor::m_stackTrace
Gaudi::Property< bool > m_stackTrace
Definition: StalledEventMonitor.h:65
IIncidentSvc
Definition: IIncidentSvc.h:33
Incident
Definition: Incident.h:27
std::unique_ptr< WatchdogThread >
StalledEventMonitor::start
StatusCode start() override
Start the watchdog thread (before entering the event loop).
Definition: StalledEventMonitor.cpp:119
Gaudi::Property< unsigned int >