The Gaudi Framework  v38r3 (c3fc9673)
StalledEventMonitor.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 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:
61  Gaudi::Property<unsigned int> m_eventTimeout{ this, "EventTimeout", 600,
62  "[[deprecated]] **use Gaudi::EventWatchdogAlg** - Number of seconds "
63  "allowed to process a single event (0 to disable the check)." };
64  Gaudi::Property<int> m_maxTimeoutCount{ this, "MaxTimeoutCount", 0,
65  "[[deprecated]] **use Gaudi::EventWatchdogAlg** - Number timeouts before "
66  "aborting the execution (0 means never abort)." };
68  this, "StackTrace", false,
69  "[[deprecated]] **use Gaudi::EventWatchdogAlg** - Whether to print the stack-trace on timeout." };
70 
73 
76 };
77 
78 #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:88
WatchdogThread
Definition: WatchdogThread.h:27
StatusCode
Definition: StatusCode.h:65
StalledEventMonitor::finalize
StatusCode finalize() override
Finalization of the service.
Definition: StalledEventMonitor.cpp:133
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:64
StalledEventMonitor::handle
void handle(const Incident &) override
Notify the watchdog thread for a new event.
Definition: StalledEventMonitor.cpp:122
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:72
StalledEventMonitor::stop
StatusCode stop() override
Stop the watchdog thread (after the event loop).
Definition: StalledEventMonitor.cpp:127
IIncidentListener.h
StalledEventMonitor::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to the incident service.
Definition: StalledEventMonitor.h:75
StalledEventMonitor::m_stackTrace
Gaudi::Property< bool > m_stackTrace
Definition: StalledEventMonitor.h:67
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:116
Gaudi::Property< unsigned int >