ATLAS Offline Software
Loading...
Searching...
No Matches
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
26class SchedulerMonSvc : public extends<AthService, ISchedulerMonSvc> {
27public:
28
29 // Clock type used in IScheduler::OccupancySnapshot::time
30 using ClockType = decltype(IScheduler::OccupancySnapshot::time)::clock;
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
44private:
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
Header file to be included by clients of the Monitored infrastructure.
std::atomic_size_t m_lastSnapCounter
std::atomic_bool m_running
virtual StatusCode initialize() override
virtual StatusCode stopMonitoring() override
Stop querying and monitoring Scheduler status.
ClockType::time_point m_startTime
SmartIF< IScheduler > m_scheduler
SchedulerMonSvc(const std::string &name, ISvcLocator *svcLoc)
virtual StatusCode startMonitoring() override
Start querying and monitoring Scheduler status.
Gaudi::Property< unsigned int > m_monIntervalMillisec
ToolHandle< GenericMonitoringTool > m_monTool
virtual ~SchedulerMonSvc() override=default
decltype(IScheduler::OccupancySnapshot::time)::clock ClockType
Gaudi::Property< std::string > m_schedulerName