ROOT  6.06/09
Reference Guide
TPerfStats.h
Go to the documentation of this file.
1 // @(#)root/proofplayer:$Id$
2 // Author: Kristjan Gulbrandsen 11/05/04
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TPerfStats
13 #define ROOT_TPerfStats
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TPerfStats //
18 // //
19 // Provides the interface for the PROOF internal performance measurment //
20 // and event tracing. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 
25 #ifndef ROOT_TObject
26 #include "TObject.h"
27 #endif
28 #ifndef ROOT_TObjArray
29 #include "TObjArray.h"
30 #endif
31 #ifndef ROOT_TTimeStamp
32 #include "TTimeStamp.h"
33 #endif
34 #ifndef ROOT_TString
35 #include "TString.h"
36 #endif
37 #ifndef ROOT_TVirtualPerfStats
38 #include "TVirtualPerfStats.h"
39 #endif
40 
41 
42 class TDSet;
43 class TH1D;
44 class TH1I;
45 class TH2D;
46 class TList;
47 class TTree;
48 
49 class TPerfEvent : public TObject {
50 
51 public:
52  TString fEvtNode; // node on which the event was generated
53  TTimeStamp fTimeStamp; // time offset from start of run
68 
69  TPerfEvent(TTimeStamp *offset = 0);
70  virtual ~TPerfEvent() {}
71 
72  Bool_t IsSortable() const { return kTRUE; }
73  Int_t Compare(const TObject *obj) const;
74  void Print(Option_t *option="") const;
75 
76  ClassDef(TPerfEvent,3) // Class holding TProof Event Info
77 };
78 
79 
80 class TPerfStats : public TVirtualPerfStats {
81 
82 friend class TProofMonSender;
83 
84 private:
85  TTree *fTrace; //!TTree with trace events
86  TTimeStamp fTzero; //!start time of this run
87  TPerfEvent *fPerfEvent; //!TPerfEvent used to fill tree
88  TH1D *fPacketsHist; //!histogram of packets processed per slave
89  TH1I *fProcPcktHist; //!histogram of packets being processed per slave
90  TH1D *fEventsHist; //!histogram of events processed per slave
91  TH1D *fNodeHist; //!histogram of slaves per file serving node
92  TH2D *fLatencyHist; //!histogram of latency due to packet requests
93  TH2D *fProcTimeHist; //!histogram of real time spent processing packets
94  TH2D *fCpuTimeHist; //!histogram of cpu time spent processing packets
95  Long64_t fBytesRead; //!track bytes read of main file
96  Double_t fTotCpuTime; //!total cpu time of all slaves
97  Long64_t fTotBytesRead; //!total bytes read on all slaves
98  Long64_t fTotEvents; //!total number of events processed
99  Long64_t fNumEvents; //!total number of events to be processed
100  Int_t fSlaves; //!number of active slaves
101 
102  Bool_t fDoHist; //!Fill histos
103  Bool_t fDoTrace; //!Trace details in master
104  Bool_t fDoTraceRate; //!Trace processing rate in master
105  Bool_t fDoSlaveTrace; //!Full tracing in workers
106  Bool_t fDoQuota; //!Save stats on SQL server for quota management
107 
108  Bool_t fMonitorPerPacket; //!Whether to send the full entry per each packet
109 
110  TObjArray fMonSenders; //!Monitoring engines
111 
112  TString fDataSet; //!Dataset string
113  Int_t fDataSetLen; //!Maximum size of the dataset string fDataSet
114  Int_t fDataSetSize; //!# of files in the dataset
115  TDSet *fDSet; //!Saved pointer to the TDSet object
116  TList *fOutput; //!Saved pointer to the output list
117 
118  static Long_t fgVirtMemMax; //! Max virtual memory used by this process
119  static Long_t fgResMemMax; //! Max resident memory used by this process
120 
121  TPerfStats(TList *input, TList *output);
122  void WriteQueryLog();
123 
124 public:
125  virtual ~TPerfStats();
126 
128  void PacketEvent(const char *slave, const char *slavename, const char *filename,
129  Long64_t eventsprocessed, Double_t latency,
130  Double_t proctime, Double_t cputime, Long64_t bytesRead);
131  void FileEvent(const char *slave, const char *slavename, const char *nodename, const char *filename,
132  Bool_t isStart);
133 
134  void FileOpenEvent(TFile *file, const char *filename, Double_t start);
135  void FileReadEvent(TFile *file, Int_t len, Double_t start);
136  void UnzipEvent(TObject *tree, Long64_t pos, Double_t start, Int_t complen, Int_t objlen);
137  void RateEvent(Double_t proctime, Double_t deltatime,
138  Long64_t eventsprocessed, Long64_t bytesRead);
139  void SetBytesRead(Long64_t num);
140  Long64_t GetBytesRead() const;
141  void SetNumEvents(Long64_t num) { fNumEvents = num; }
142  Long64_t GetNumEvents() const { return fNumEvents; }
143 
144  static void Start(TList *input, TList *output);
145  static void Stop();
146  static void Setup(TList *input);
147  static void SetMemValues();
148  static void GetMemValues(Long_t &vmax, Long_t &rmax);
149 
150  ClassDef(TPerfStats,0) // Class for collecting PROOF statistics
151 };
152 
153 
154 #endif
Bool_t fIsOk
Definition: TPerfStats.h:67
TVirtualPerfStats::EEventType fType
Definition: TPerfStats.h:54
An array of TObjects.
Definition: TObjArray.h:39
long long Long64_t
Definition: RtypesCore.h:69
Bool_t fDoHist
number of active slaves
Definition: TPerfStats.h:102
TH1D * fEventsHist
histogram of packets being processed per slave
Definition: TPerfStats.h:90
TList * fOutput
Saved pointer to the TDSet object.
Definition: TPerfStats.h:116
Provides the interface for the PROOF internal performance measurement and event tracing.
const char Option_t
Definition: RtypesCore.h:62
void SetNumEvents(Long64_t num)
Definition: TPerfStats.h:141
Definition: TDSet.h:153
TDSet * fDSet
of files in the dataset
Definition: TPerfStats.h:115
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:45
static const char * filename()
Bool_t fIsStart
Definition: TPerfStats.h:66
TPerfStats(TList *input, TList *output)
Max resident memory used by this process.
Definition: TPerfStats.cxx:120
TString fSlaveName
Definition: TPerfStats.h:55
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TTimeStamp fTzero
TTree with trace events.
Definition: TPerfStats.h:86
TString fNodeName
Definition: TPerfStats.h:56
Long64_t fNumEvents
total number of events processed
Definition: TPerfStats.h:99
Double_t fCpuTime
Definition: TPerfStats.h:65
static Long_t fgVirtMemMax
Saved pointer to the output list.
Definition: TPerfStats.h:118
Long64_t GetBytesRead() const
Get number of bytes read.
Definition: TPerfStats.cxx:639
void WriteQueryLog()
Send to the connected monitoring servers information related to this query.
Definition: TPerfStats.cxx:650
virtual ~TPerfEvent()
Definition: TPerfStats.h:70
Bool_t IsSortable() const
Definition: TPerfStats.h:72
void PacketEvent(const char *slave, const char *slavename, const char *filename, Long64_t eventsprocessed, Double_t latency, Double_t proctime, Double_t cputime, Long64_t bytesRead)
Packet event.
Definition: TPerfStats.cxx:415
TH1D * fNodeHist
histogram of events processed per slave
Definition: TPerfStats.h:91
void RateEvent(Double_t proctime, Double_t deltatime, Long64_t eventsprocessed, Long64_t bytesRead)
Rate event.
Definition: TPerfStats.cxx:609
#define ClassDef(name, id)
Definition: Rtypes.h:254
TH2D * fLatencyHist
histogram of slaves per file serving node
Definition: TPerfStats.h:92
TH1D * fPacketsHist
TPerfEvent used to fill tree.
Definition: TPerfStats.h:88
void SimpleEvent(EEventType type)
Simple event.
Definition: TPerfStats.cxx:389
Bool_t fDoQuota
Full tracing in workers.
Definition: TPerfStats.h:106
TString fEvtNode
Definition: TPerfStats.h:52
TObjArray fMonSenders
Whether to send the full entry per each packet.
Definition: TPerfStats.h:110
void SetBytesRead(Long64_t num)
Set number of bytes read.
Definition: TPerfStats.cxx:631
static void GetMemValues(Long_t &vmax, Long_t &rmax)
Get memory usage.
Definition: TPerfStats.cxx:792
Double_t fTotCpuTime
track bytes read of main file
Definition: TPerfStats.h:96
Bool_t fDoSlaveTrace
Trace processing rate in master.
Definition: TPerfStats.h:105
static void Start(TList *input, TList *output)
Initialize PROOF statistics run.
Definition: TPerfStats.cxx:746
A doubly linked list.
Definition: TList.h:47
TH1I * fProcPcktHist
histogram of packets processed per slave
Definition: TPerfStats.h:89
void UnzipEvent(TObject *tree, Long64_t pos, Double_t start, Int_t complen, Int_t objlen)
Record TTree file unzip event.
Definition: TPerfStats.cxx:599
TString fDataSet
Monitoring engines.
Definition: TPerfStats.h:112
static void Setup(TList *input)
Setup the PROOF input list with requested statistics and tracing options.
Definition: TPerfStats.cxx:729
Long64_t fTotEvents
total bytes read on all slaves
Definition: TPerfStats.h:98
Bool_t fMonitorPerPacket
Save stats on SQL server for quota management.
Definition: TPerfStats.h:108
TPerfEvent * fPerfEvent
start time of this run
Definition: TPerfStats.h:87
Long64_t fEventsProcessed
Definition: TPerfStats.h:60
Double_t fProcTime
Definition: TPerfStats.h:64
Int_t fSlaves
total number of events to be processed
Definition: TPerfStats.h:100
1-D histogram with a int per channel (see TH1 documentation)}
Definition: TH1.h:529
Long64_t GetNumEvents() const
Definition: TPerfStats.h:142
TString fFileName
Definition: TPerfStats.h:57
Long64_t fBytesRead
histogram of cpu time spent processing packets
Definition: TPerfStats.h:95
Int_t fDataSetSize
Maximum size of the dataset string fDataSet.
Definition: TPerfStats.h:114
static Long_t fgResMemMax
Max virtual memory used by this process.
Definition: TPerfStats.h:119
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:613
long Long_t
Definition: RtypesCore.h:50
TTimeStamp fTimeStamp
Definition: TPerfStats.h:53
TString fSlave
Definition: TPerfStats.h:59
double Double_t
Definition: RtypesCore.h:55
void Print(Option_t *option="") const
Dump content of this instance.
Definition: TPerfStats.cxx:100
int type
Definition: TGX11.cxx:120
The TTimeStamp encapsulates seconds and ns since EPOCH.
Definition: TTimeStamp.h:76
TString fFileClass
Definition: TPerfStats.h:58
TPerfEvent(TTimeStamp *offset=0)
Int_t fDataSetLen
Dataset string.
Definition: TPerfStats.h:113
Long64_t fLen
Definition: TPerfStats.h:62
Bool_t fDoTrace
Fill histos.
Definition: TPerfStats.h:103
void FileOpenEvent(TFile *file, const char *filename, Double_t start)
Open file event.
Definition: TPerfStats.cxx:553
Mother of all ROOT objects.
Definition: TObject.h:58
Long64_t fBytesRead
Definition: TPerfStats.h:61
TTree * fTrace
Definition: TPerfStats.h:85
virtual ~TPerfStats()
Destructor.
Definition: TPerfStats.cxx:379
Long64_t fTotBytesRead
total cpu time of all slaves
Definition: TPerfStats.h:97
Bool_t fDoTraceRate
Trace details in master.
Definition: TPerfStats.h:104
Double_t fLatency
Definition: TPerfStats.h:63
void FileEvent(const char *slave, const char *slavename, const char *nodename, const char *filename, Bool_t isStart)
File event.
Definition: TPerfStats.cxx:526
static void Stop()
Terminate the PROOF statistics run.
Definition: TPerfStats.cxx:766
A TTree object has a header with a name and a title.
Definition: TTree.h:94
TH2D * fCpuTimeHist
histogram of real time spent processing packets
Definition: TPerfStats.h:94
static void output(int code)
Definition: gifencode.c:226
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
TH2D * fProcTimeHist
histogram of latency due to packet requests
Definition: TPerfStats.h:93
static void SetMemValues()
Record memory usage.
Definition: TPerfStats.cxx:780
void FileReadEvent(TFile *file, Int_t len, Double_t start)
Read file event.
Definition: TPerfStats.cxx:574
Int_t Compare(const TObject *obj) const
Compare method.
Definition: TPerfStats.cxx:79
2-D histogram with a double per channel (see TH1 documentation)}
Definition: TH2.h:297