All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RootPerfMonSvc.h
Go to the documentation of this file.
1 // $Id: RootPerfMonSvc.h,v 1.7 2010-09-14 06:01:12 frankb Exp $
2 //====================================================================
3 // RootPerfMonSvc definition
4 //--------------------------------------------------------------------
5 //
6 // Author : M.Frank
7 //====================================================================
8 #ifndef GAUDIROOTCNV_GAUDIROOTPERFMONSVC_H
9 #define GAUDIROOTCNV_GAUDIROOTPERFMONSVC_H
10 // $Header: /afs/cern.ch/project/cvs/reps/lhcb/Online/RootCnv/src/RootPerfMonSvc.h,v 1.7 2010-09-14 06:01:12 frankb Exp $
11 
12 // Framework include files
14 #include "GaudiKernel/Service.h"
15 
16 #include "TTree.h"
17 #include "TFile.h"
18 
19 #include "RootCnv/SysProcStat.h"
20 
21 // C/C++ include files
22 #include <set>
23 
24 // Forward declarations
25 class IIncidentSvc;
26 
27 /*
28  * Gaudi namespace declaration
29  */
30 namespace Gaudi {
31 
42  class GAUDI_API RootPerfMonSvc : public Service, virtual public IIncidentListener {
43  protected:
44 
48  std::string m_ioPerfStats;
51  // Passed parameters
52  std::string m_setStreams;
53  std::string m_basketSize;
54  std::string m_bufferSize;
55  std::string m_splitLevel;
56  // Reference to a tree with statistics
57  TTree* m_perfTree;
58  // Reference to a file where statistics are persisted
59  TFile* m_perfFile;
60  // Reference to all connected output files
61  std::set<std::string> m_outputs;
62  // The newest observed values
63  Int_t m_eventType;
64  ULong_t m_utime, m_stime, m_vsize;
65  Long_t m_eventNumber, m_rss, m_time;
66 
67  // Types of records
68  enum EventType { EVENT = 1, FSR = 2 };
69 
70  // Adding newest observed values to the tree with statistics
71  virtual void record(EventType eventType);
72 
74  MsgStream& log() const { return *m_log; }
75 
76  public:
78  RootPerfMonSvc(const std::string& name, ISvcLocator* svc);
79 
81  virtual ~RootPerfMonSvc();
82 
88  StatusCode error(const std::string& msg);
89 
91  virtual StatusCode initialize();
92 
94  virtual StatusCode finalize();
95 
97  virtual void handle(const Incident& incident);
98 
99  // Service overload: Stop the service
100  virtual StatusCode stop();
101  };
102 }
103 
104 #endif // GAUDIROOTCNV_GAUDIROOTPERFMONSVC_H
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:26
MsgStream * m_log
Message streamer.
std::string m_ioPerfStats
Property: Enable TTree IOperfStats if not empty; otherwise perf stat file name.
The interface implemented by any class wanting to listen to Incidents.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
std::string m_splitLevel
IIncidentSvc * m_incidentSvc
Reference to incident service.
std::string m_setStreams
std::string m_bufferSize
MsgStream & log() const
Helper: Use message streamer.
std::string m_basketSize
Base class for all Incidents (computing events).
Definition: Incident.h:16
This is a number of static methods for bootstrapping the Gaudi framework.
Definition: Bootstrap.h:15
std::set< std::string > m_outputs
Base class for all services.
Definition: Service.h:33
#define GAUDI_API
Definition: Kernel.h:108
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:22