ATLAS Offline Software
SchedulerMonSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef TRIGSTEERMONITOR_SCHEDULERMONSVC_H
5 #define TRIGSTEERMONITOR_SCHEDULERMONSVC_H
6 
7 // Local includes
9 
10 // Athena includes
13 
14 // Gaudi includes
15 #include "GaudiKernel/SmartIF.h"
16 #include "GaudiKernel/IScheduler.h"
17 
18 // System includes
19 #include <atomic>
20 #include <chrono>
21 
26 class SchedulerMonSvc : public extends<AthService, ISchedulerMonSvc> {
27 public:
28 
29  // Clock type used in IScheduler::OccupancySnapshot::time
31 
32  SchedulerMonSvc(const std::string& name, ISvcLocator* svcLoc);
33  virtual ~SchedulerMonSvc() override = default;
34 
35  // IService methods
36  virtual StatusCode initialize() override;
37 
38  // ISchedulerMonSvc methods
40  virtual StatusCode startMonitoring() override;
42  virtual StatusCode stopMonitoring() override;
43 
44 private:
45  // Properties and handles
46  Gaudi::Property<std::string> m_schedulerName {
47  this, "SchedulerName", "AvalancheSchedulerSvc", "Name of the scheduler"};
48  Gaudi::Property<unsigned int> m_monIntervalMillisec {
49  this, "MonIntervalMillisec", 100, "Monitoring snapshot interval in milliseconds"};
50  ToolHandle<GenericMonitoringTool> m_monTool {
51  this, "MonTool", "", "Monitoring tool"};
52 
53  // Other private members
54  SmartIF<IScheduler> m_scheduler {nullptr};
55  std::atomic_bool m_running {false};
56  ClockType::time_point m_startTime {};
57  std::atomic_size_t m_lastSnapCounter {0};
58 };
59 
60 #endif // TRIGSTEERMONITOR_SCHEDULERMONSVC_H
SchedulerMonSvc::m_scheduler
SmartIF< IScheduler > m_scheduler
Definition: SchedulerMonSvc.h:54
ISchedulerMonSvc.h
SchedulerMonSvc::SchedulerMonSvc
SchedulerMonSvc(const std::string &name, ISvcLocator *svcLoc)
Definition: SchedulerMonSvc.cxx:43
SchedulerMonSvc::stopMonitoring
virtual StatusCode stopMonitoring() override
Stop querying and monitoring Scheduler status.
Definition: SchedulerMonSvc.cxx:159
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SchedulerMonSvc
Service monitoring the Scheduler status and producing relevant online histograms.
Definition: SchedulerMonSvc.h:26
SchedulerMonSvc::m_schedulerName
Gaudi::Property< std::string > m_schedulerName
Definition: SchedulerMonSvc.h:46
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
SchedulerMonSvc::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: SchedulerMonSvc.h:50
SchedulerMonSvc::m_lastSnapCounter
std::atomic_size_t m_lastSnapCounter
Definition: SchedulerMonSvc.h:57
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SchedulerMonSvc::m_startTime
ClockType::time_point m_startTime
Definition: SchedulerMonSvc.h:56
SchedulerMonSvc::ClockType
decltype(IScheduler::OccupancySnapshot::time)::clock ClockType
Definition: SchedulerMonSvc.h:30
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
SchedulerMonSvc::~SchedulerMonSvc
virtual ~SchedulerMonSvc() override=default
SchedulerMonSvc::initialize
virtual StatusCode initialize() override
Definition: SchedulerMonSvc.cxx:47
SchedulerMonSvc::m_running
std::atomic_bool m_running
Definition: SchedulerMonSvc.h:55
AthService.h
SchedulerMonSvc::m_monIntervalMillisec
Gaudi::Property< unsigned int > m_monIntervalMillisec
Definition: SchedulerMonSvc.h:48
SchedulerMonSvc::startMonitoring
virtual StatusCode startMonitoring() override
Start querying and monitoring Scheduler status.
Definition: SchedulerMonSvc.cxx:53