Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (d98a2936)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
RootPerfMonSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 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 // RootPerfMonSvc definition
13 //--------------------------------------------------------------------
14 //
15 // Author : M.Frank
16 //====================================================================
17 #pragma once
18 
19 #include <memory>
20 // Framework include files
23 #include <GaudiKernel/Service.h>
24 
25 #include <TFile.h>
26 #include <TTree.h>
27 
28 #include <RootCnv/SysProcStat.h>
29 
30 // C/C++ include files
31 #include <set>
32 
33 /*
34  * Gaudi namespace declaration
35  */
36 namespace Gaudi {
37 
48  class GAUDI_API RootPerfMonSvc : public extends<Service, IIncidentListener> {
49  protected:
51  this, "IOPerfStats", "", "Enable TTree IOperfStats if not empty; otherwise perf stat file name" };
52  // Passed parameters
53  Gaudi::Property<std::string> m_setStreams{ this, "Streams", "", "" };
54  Gaudi::Property<std::string> m_basketSize{ this, "BasketSize", "", "" };
55  Gaudi::Property<std::string> m_bufferSize{ this, "BufferSize", "", "" };
56  Gaudi::Property<std::string> m_splitLevel{ this, "SplitLevel", "", "" };
57 
61  std::unique_ptr<MsgStream> m_log;
62  // Reference to a tree with statistics
63  TTree* m_perfTree;
64  // Reference to a file where statistics are persisted
65  std::unique_ptr<TFile> m_perfFile;
66  // Reference to all connected output files
67  std::set<std::string> m_outputs;
68  // The newest observed values
69  Int_t m_eventType;
70  ULong_t m_utime, m_stime, m_vsize;
71  Long_t m_eventNumber, m_rss, m_time;
72 
73  // Types of records
74  enum EventType { EVENT = 1, FSR = 2 };
75 
76  // Adding newest observed values to the tree with statistics
77  virtual void record( EventType eventType );
78 
80  MsgStream& log() const { return *m_log; }
81 
82  public:
84  using extends::extends;
85 
91  StatusCode error( const std::string& msg );
92 
94  StatusCode initialize() override;
95 
97  StatusCode finalize() override;
98 
100  void handle( const Incident& incident ) override;
101 
102  // Service overload: Stop the service
103  StatusCode stop() override;
104  };
105 } // namespace Gaudi
Gaudi::RootPerfMonSvc::m_perfTree
TTree * m_perfTree
Definition: RootPerfMonSvc.h:63
Gaudi::RootPerfMonSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
Definition: RootPerfMonSvc.h:59
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:19
Gaudi::RootPerfMonSvc::m_outputs
std::set< std::string > m_outputs
Definition: RootPerfMonSvc.h:67
Gaudi::RootPerfMonSvc
Definition: RootPerfMonSvc.h:48
Gaudi::RootPerfMonSvc::m_log
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition: RootPerfMonSvc.h:61
Gaudi::RootPerfMonSvc::m_perfFile
std::unique_ptr< TFile > m_perfFile
Definition: RootPerfMonSvc.h:65
Gaudi::RootPerfMonSvc::m_eventType
Int_t m_eventType
Definition: RootPerfMonSvc.h:69
IIncidentSvc.h
SysProcStat.h
StatusCode
Definition: StatusCode.h:64
Gaudi::RootPerfMonSvc::m_time
Long_t m_time
Definition: RootPerfMonSvc.h:71
Gaudi::RootPerfMonSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootPerfMonSvc.h:80
SmartIF< IIncidentSvc >
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:19
MsgStream
Definition: MsgStream.h:29
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition: __init__.py:1
Service.h
IIncidentListener.h
Gaudi::RootPerfMonSvc::m_vsize
ULong_t m_vsize
Definition: RootPerfMonSvc.h:70
Gaudi::RootPerfMonSvc::EventType
EventType
Definition: RootPerfMonSvc.h:74
Incident
Definition: Incident.h:24
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:49
Gaudi::Property< std::string >