Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include "TObject.h"
26#include "TObjArray.h"
27#include "TTimeStamp.h"
28#include "TString.h"
29#include "TVirtualPerfStats.h"
30
31
32class TDSet;
33class TH1D;
34class TH1I;
35class TH2D;
36class TList;
37class TTree;
38
39class TPerfEvent : public TObject {
40
41public:
42 TString fEvtNode; // node on which the event was generated
43 TTimeStamp fTimeStamp; // time offset from start of run
58
60 ~TPerfEvent() override {}
61
62 Bool_t IsSortable() const override { return kTRUE; }
63 Int_t Compare(const TObject *obj) const override;
64 void Print(Option_t *option="") const override;
65
66 ClassDefOverride(TPerfEvent,3) // Class holding TProof Event Info
67};
68
69
71
72friend class TProofMonSender;
73
74private:
75 TTree *fTrace; //!TTree with trace events
76 TTimeStamp fTzero; //!start time of this run
77 TPerfEvent *fPerfEvent; //!TPerfEvent used to fill tree
78 TH1D *fPacketsHist; //!histogram of packets processed per slave
79 TH1I *fProcPcktHist; //!histogram of packets being processed per slave
80 TH1D *fEventsHist; //!histogram of events processed per slave
81 TH1D *fNodeHist; //!histogram of slaves per file serving node
82 TH2D *fLatencyHist; //!histogram of latency due to packet requests
83 TH2D *fProcTimeHist; //!histogram of real time spent processing packets
84 TH2D *fCpuTimeHist; //!histogram of cpu time spent processing packets
85 Long64_t fBytesRead; //!track bytes read of main file
86 Double_t fTotCpuTime; //!total cpu time of all slaves
87 Long64_t fTotBytesRead; //!total bytes read on all slaves
88 Long64_t fTotEvents; //!total number of events processed
89 Long64_t fNumEvents; //!total number of events to be processed
90 Int_t fSlaves; //!number of active slaves
91
92 Bool_t fDoHist; //!Fill histos
93 Bool_t fDoTrace; //!Trace details in master
94 Bool_t fDoTraceRate; //!Trace processing rate in master
95 Bool_t fDoSlaveTrace; //!Full tracing in workers
96 Bool_t fDoQuota; //!Save stats on SQL server for quota management
97
98 Bool_t fMonitorPerPacket; //!Whether to send the full entry per each packet
99
100 TObjArray fMonSenders; //!Monitoring engines
101
102 TString fDataSet; //!Dataset string
103 Int_t fDataSetLen; //!Maximum size of the dataset string fDataSet
104 Int_t fDataSetSize; //!# of files in the dataset
105 TDSet *fDSet; //!Saved pointer to the TDSet object
106 TList *fOutput; //!Saved pointer to the output list
107
108 static Long_t fgVirtMemMax; //! Max virtual memory used by this process
109 static Long_t fgResMemMax; //! Max resident memory used by this process
110
112 void WriteQueryLog();
113
114 void SetFile(TFile *) override {}
115
116public:
117 ~TPerfStats() override;
118
119 void SimpleEvent(EEventType type) override;
120 void PacketEvent(const char *slave, const char *slavename, const char *filename,
121 Long64_t eventsprocessed, Double_t latency,
122 Double_t proctime, Double_t cputime, Long64_t bytesRead) override;
123 void FileEvent(const char *slave, const char *slavename, const char *nodename, const char *filename,
124 Bool_t isStart) override;
125
126 void FileOpenEvent(TFile *file, const char *filename, Double_t start) override;
127 void FileReadEvent(TFile *file, Int_t len, Double_t start) override;
128 void UnzipEvent(TObject *tree, Long64_t pos, Double_t start, Int_t complen, Int_t objlen) override;
129 void RateEvent(Double_t proctime, Double_t deltatime,
130 Long64_t eventsprocessed, Long64_t bytesRead) override;
131 void SetBytesRead(Long64_t num) override;
132 Long64_t GetBytesRead() const override;
133 void SetNumEvents(Long64_t num) override { fNumEvents = num; }
134 Long64_t GetNumEvents() const override { return fNumEvents; }
135
136 void PrintBasketInfo(Option_t * = "") const override {}
137 void SetLoaded(TBranch *, size_t) override {}
138 void SetLoaded(size_t, size_t) override {}
139 void SetLoadedMiss(TBranch *, size_t) override {}
140 void SetLoadedMiss(size_t, size_t) override {}
141 void SetMissed(TBranch *, size_t) override {}
142 void SetMissed(size_t, size_t) override {}
143 void SetUsed(TBranch *, size_t) override {}
144 void SetUsed(size_t, size_t) override {}
145 void UpdateBranchIndices(TObjArray *) override {}
146
147 static void Start(TList *input, TList *output);
148 static void Stop();
149 static void Setup(TList *input);
150 static void SetMemValues();
151 static void GetMemValues(Long_t &vmax, Long_t &rmax);
152
153 ClassDefOverride(TPerfStats,0) // Class for collecting PROOF statistics
154};
155
156
157#endif
EEventType
Definition Buttons.h:15
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
long Long_t
Definition RtypesCore.h:54
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:80
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
A TTree is a list of TBranches.
Definition TBranch.h:93
This class implements a data set to be used for PROOF processing.
Definition TDSet.h:153
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:53
1-D histogram with a double per channel (see TH1 documentation)
Definition TH1.h:669
1-D histogram with an int per channel (see TH1 documentation)
Definition TH1.h:539
2-D histogram with a double per channel (see TH1 documentation)
Definition TH2.h:357
A doubly linked list.
Definition TList.h:38
An array of TObjects.
Definition TObjArray.h:31
Mother of all ROOT objects.
Definition TObject.h:41
TString fEvtNode
Definition TPerfStats.h:42
TString fSlaveName
Definition TPerfStats.h:45
Double_t fCpuTime
Definition TPerfStats.h:55
Double_t fLatency
Definition TPerfStats.h:53
Bool_t fIsOk
Definition TPerfStats.h:57
TString fSlave
Definition TPerfStats.h:49
Int_t Compare(const TObject *obj) const override
Compare method.
TString fFileName
Definition TPerfStats.h:47
void Print(Option_t *option="") const override
Dump content of this instance.
~TPerfEvent() override
Definition TPerfStats.h:60
Bool_t IsSortable() const override
Definition TPerfStats.h:62
TString fFileClass
Definition TPerfStats.h:48
TVirtualPerfStats::EEventType fType
Definition TPerfStats.h:44
Bool_t fIsStart
Definition TPerfStats.h:56
Double_t fProcTime
Definition TPerfStats.h:54
Long64_t fBytesRead
Definition TPerfStats.h:51
Long64_t fLen
Definition TPerfStats.h:52
TTimeStamp fTimeStamp
Definition TPerfStats.h:43
Long64_t fEventsProcessed
Definition TPerfStats.h:50
TString fNodeName
Definition TPerfStats.h:46
Provides the interface for the PROOF internal performance measurement and event tracing.
Definition TPerfStats.h:70
void SetBytesRead(Long64_t num) override
Set number of bytes read.
TString fDataSet
Monitoring engines.
Definition TPerfStats.h:102
static Long_t fgResMemMax
Max virtual memory used by this process.
Definition TPerfStats.h:109
void SetLoaded(size_t, size_t) override
Definition TPerfStats.h:138
void SetLoadedMiss(size_t, size_t) override
Definition TPerfStats.h:140
void SetLoaded(TBranch *, size_t) override
Definition TPerfStats.h:137
Int_t fDataSetLen
Dataset string.
Definition TPerfStats.h:103
TPerfEvent * fPerfEvent
start time of this run
Definition TPerfStats.h:77
Long64_t fBytesRead
histogram of cpu time spent processing packets
Definition TPerfStats.h:85
void UpdateBranchIndices(TObjArray *) override
Definition TPerfStats.h:145
~TPerfStats() override
Destructor.
static Long_t fgVirtMemMax
Saved pointer to the output list.
Definition TPerfStats.h:108
void SetUsed(size_t, size_t) override
Definition TPerfStats.h:144
TTree * fTrace
Definition TPerfStats.h:75
void SetMissed(size_t, size_t) override
Definition TPerfStats.h:142
TH1D * fPacketsHist
TPerfEvent used to fill tree.
Definition TPerfStats.h:78
Long64_t GetNumEvents() const override
Definition TPerfStats.h:134
TList * fOutput
Saved pointer to the TDSet object.
Definition TPerfStats.h:106
void SetNumEvents(Long64_t num) override
Definition TPerfStats.h:133
Long64_t fNumEvents
total number of events processed
Definition TPerfStats.h:89
Int_t fDataSetSize
Maximum size of the dataset string fDataSet.
Definition TPerfStats.h:104
TH2D * fCpuTimeHist
histogram of real time spent processing packets
Definition TPerfStats.h:84
static void SetMemValues()
Record memory usage.
void SetFile(TFile *) override
Definition TPerfStats.h:114
void RateEvent(Double_t proctime, Double_t deltatime, Long64_t eventsprocessed, Long64_t bytesRead) override
Rate event.
TH1D * fNodeHist
histogram of events processed per slave
Definition TPerfStats.h:81
void WriteQueryLog()
Send to the connected monitoring servers information related to this query.
void SetMissed(TBranch *, size_t) override
Definition TPerfStats.h:141
static void Setup(TList *input)
Setup the PROOF input list with requested statistics and tracing options.
Bool_t fDoTraceRate
Trace details in master.
Definition TPerfStats.h:94
void SimpleEvent(EEventType type) override
Simple event.
TH2D * fProcTimeHist
histogram of latency due to packet requests
Definition TPerfStats.h:83
TH2D * fLatencyHist
histogram of slaves per file serving node
Definition TPerfStats.h:82
TH1I * fProcPcktHist
histogram of packets processed per slave
Definition TPerfStats.h:79
void FileEvent(const char *slave, const char *slavename, const char *nodename, const char *filename, Bool_t isStart) override
File event.
static void Stop()
Terminate the PROOF statistics run.
void PrintBasketInfo(Option_t *="") const override
Definition TPerfStats.h:136
TDSet * fDSet
Definition TPerfStats.h:105
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) override
Packet event.
Bool_t fDoTrace
Fill histos.
Definition TPerfStats.h:93
Double_t fTotCpuTime
track bytes read of main file
Definition TPerfStats.h:86
TH1D * fEventsHist
histogram of packets being processed per slave
Definition TPerfStats.h:80
Bool_t fDoHist
number of active slaves
Definition TPerfStats.h:92
void UnzipEvent(TObject *tree, Long64_t pos, Double_t start, Int_t complen, Int_t objlen) override
Record TTree file unzip event.
void SetLoadedMiss(TBranch *, size_t) override
Definition TPerfStats.h:139
void SetUsed(TBranch *, size_t) override
Definition TPerfStats.h:143
static void GetMemValues(Long_t &vmax, Long_t &rmax)
Get memory usage.
Long64_t fTotEvents
total bytes read on all slaves
Definition TPerfStats.h:88
TTimeStamp fTzero
TTree with trace events.
Definition TPerfStats.h:76
Long64_t GetBytesRead() const override
Get number of bytes read.
static void Start(TList *input, TList *output)
Initialize PROOF statistics run.
void FileReadEvent(TFile *file, Int_t len, Double_t start) override
Read file event.
Bool_t fDoSlaveTrace
Trace processing rate in master.
Definition TPerfStats.h:95
Bool_t fMonitorPerPacket
Save stats on SQL server for quota management.
Definition TPerfStats.h:98
Long64_t fTotBytesRead
total cpu time of all slaves
Definition TPerfStats.h:87
TObjArray fMonSenders
Whether to send the full entry per each packet.
Definition TPerfStats.h:100
void FileOpenEvent(TFile *file, const char *filename, Double_t start) override
Open file event.
Int_t fSlaves
total number of events to be processed
Definition TPerfStats.h:90
Bool_t fDoQuota
Full tracing in workers.
Definition TPerfStats.h:96
Provides the interface for PROOF monitoring to different writers.
Basic string class.
Definition TString.h:139
The TTimeStamp encapsulates seconds and ns since EPOCH.
Definition TTimeStamp.h:45
A TTree represents a columnar dataset.
Definition TTree.h:79
Provides the interface for the PROOF internal performance measurement and event tracing.
static void output()