| The Gaudi Framework v32r1 (f65d50dc)

RootPerfMonSvc.h
Go to the documentation of this file.
1 //====================================================================
2 // RootPerfMonSvc definition
3 //--------------------------------------------------------------------
4 //
5 // Author : M.Frank
6 //====================================================================
7 #ifndef GAUDIROOTCNV_GAUDIROOTPERFMONSVC_H
8 #define GAUDIROOTCNV_GAUDIROOTPERFMONSVC_H
9
10 #include <memory>
11 // Framework include files
12 #include "GaudiKernel/IIncidentListener.h"
13 #include "GaudiKernel/IIncidentSvc.h"
14 #include "GaudiKernel/Service.h"
15
16 #include "TFile.h"
17 #include "TTree.h"
18
19 #include "RootCnv/SysProcStat.h"
20
21 // C/C++ include files
22 #include <set>
23
24 /*
25 * Gaudi namespace declaration
26 */
27 namespace Gaudi {
28
39 class GAUDI_API RootPerfMonSvc : public extends<Service, IIncidentListener> {
40 protected:
41 Gaudi::Property<std::string> m_ioPerfStats{this, "IOPerfStats", "",
42 "Enable TTree IOperfStats if not empty; otherwise perf stat file name"};
43 // Passed parameters
44 Gaudi::Property<std::string> m_setStreams{this, "Streams", "", ""};
45 Gaudi::Property<std::string> m_basketSize{this, "BasketSize", "", ""};
46 Gaudi::Property<std::string> m_bufferSize{this, "BufferSize", "", ""};
47 Gaudi::Property<std::string> m_splitLevel{this, "SplitLevel", "", ""};
48
50 SmartIF<IIncidentSvc> m_incidentSvc;
52 std::unique_ptr<MsgStream> m_log;
53 // Reference to a tree with statistics
54 TTree* m_perfTree;
55 // Reference to a file where statistics are persisted
56 std::unique_ptr<TFile> m_perfFile;
57 // Reference to all connected output files
58 std::set<std::string> m_outputs;
59 // The newest observed values
60 Int_t m_eventType;
61 ULong_t m_utime, m_stime, m_vsize;
62 Long_t m_eventNumber, m_rss, m_time;
63
64 // Types of records
65 enum EventType { EVENT = 1, FSR = 2 };
66
67 // Adding newest observed values to the tree with statistics
68 virtual void record( EventType eventType );
69
71 MsgStream& log() const { return *m_log; }
72
73 public:
75 using extends::extends;
76
82 StatusCode error( const std::string& msg );
83
85 StatusCode initialize() override;
86
88 StatusCode finalize() override;
89
91 void handle( const Incident& incident ) override;
92
93 // Service overload: Stop the service
94 StatusCode stop() override;
95 };
96 } // namespace Gaudi
97
98 #endif // GAUDIROOTCNV_GAUDIROOTPERFMONSVC_H
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IIncidentSvc >
Gaudi::RootPerfMonSvc::m_eventType
Int_t m_eventType
Definition: RootPerfMonSvc.h:60
Gaudi::RootPerfMonSvc::m_time
Long_t m_time
Definition: RootPerfMonSvc.h:62
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
Gaudi::RootPerfMonSvc
Description:
Definition: RootPerfMonSvc.h:39
Gaudi::RootPerfMonSvc::m_perfFile
std::unique_ptr< TFile > m_perfFile
Definition: RootPerfMonSvc.h:56
SysProcStat.h
Gaudi::RootPerfMonSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootPerfMonSvc.h:71
Gaudi::RootPerfMonSvc::m_vsize
ULong_t m_vsize
Definition: RootPerfMonSvc.h:61
Gaudi::RootPerfMonSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
Definition: RootPerfMonSvc.h:50
std::string
STL class.
Service.h
Gaudi::RootPerfMonSvc::EventType
EventType
Definition: RootPerfMonSvc.h:65
IIncidentSvc.h
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
Gaudi::RootPerfMonSvc::m_perfTree
TTree * m_perfTree
Definition: RootPerfMonSvc.h:54
std::set< std::string >
std::unique_ptr< MsgStream >
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
Incident
Base class for all Incidents (computing events).
Definition: Incident.h:17
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:8
IIncidentListener.h
Gaudi::RootPerfMonSvc::m_outputs
std::set< std::string > m_outputs
Definition: RootPerfMonSvc.h:58
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71
Gaudi::RootPerfMonSvc::m_log
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition: RootPerfMonSvc.h:52
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1