The Gaudi Framework  v29r0 (ff2e7097)
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
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 {
29 
40  class GAUDI_API RootPerfMonSvc : public extends<Service, IIncidentListener>
41  {
42  protected:
43  Gaudi::Property<std::string> m_ioPerfStats{this, "IOPerfStats", "",
44  "Enable TTree IOperfStats if not empty; otherwise perf stat file name"};
45  // Passed parameters
46  Gaudi::Property<std::string> m_setStreams{this, "Streams", "", ""};
47  Gaudi::Property<std::string> m_basketSize{this, "BasketSize", "", ""};
48  Gaudi::Property<std::string> m_bufferSize{this, "BufferSize", "", ""};
49  Gaudi::Property<std::string> m_splitLevel{this, "SplitLevel", "", ""};
50 
55  // Reference to a tree with statistics
56  TTree* m_perfTree;
57  // Reference to a file where statistics are persisted
59  // Reference to all connected output files
61  // The newest observed values
62  Int_t m_eventType;
63  ULong_t m_utime, m_stime, m_vsize;
64  Long_t m_eventNumber, m_rss, m_time;
65 
66  // Types of records
67  enum EventType { EVENT = 1, FSR = 2 };
68 
69  // Adding newest observed values to the tree with statistics
70  virtual void record( EventType eventType );
71 
73  MsgStream& log() const { return *m_log; }
74 
75  public:
77  using extends::extends;
78 
80  ~RootPerfMonSvc() override = default;
81 
87  StatusCode error( const std::string& msg );
88 
90  StatusCode initialize() override;
91 
93  StatusCode finalize() override;
94 
96  void handle( const Incident& incident ) override;
97 
98  // Service overload: Stop the service
99  StatusCode stop() override;
100  };
101 }
102 
103 #endif // GAUDIROOTCNV_GAUDIROOTPERFMONSVC_H
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Implementation of property with value of concrete type.
Definition: Property.h:319
std::unique_ptr< TFile > m_perfFile
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
MsgStream & log() const
Helper: Use message streamer.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
Base class for all Incidents (computing events).
Definition: Incident.h:17
std::set< std::string > m_outputs
#define GAUDI_API
Definition: Kernel.h:110
std::unique_ptr< MsgStream > m_log
Message streamer.
Helper functions to set/get the application return code.
Definition: __init__.py:1