Logo ROOT  
Reference Guide
TVirtualPerfStats.h
Go to the documentation of this file.
1 // @(#)root/base:$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_TVirtualPerfStats
13 #define ROOT_TVirtualPerfStats
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TVirtualPerfStats //
18 // //
19 // Provides the interface for the PROOF internal performance measurment //
20 // and event tracing. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 
25 #include "TObject.h"
26 
27 
28 class TFile;
29 class TBranch;
30 
31 class TVirtualPerfStats : public TObject {
32 
33 public:
34  virtual ~TVirtualPerfStats() {}
35 
36  enum EEventType {
38  kPacket, //info of single packet processing
39  kStart, //begin of run
40  kStop, //end of run
41  kFile, //file started/finished in packetizer
42  kFileOpen, //opening data file statistics
43  kFileRead, //reading data file event
44  kRate, //processing {evt, MB} rates
45  kNumEventType //number of entries, must be last
46  };
47 
48  static TVirtualPerfStats *&CurrentPerfStats(); // Return the current perfStats for this thread.
49 
50  virtual void SimpleEvent(EEventType type) = 0;
51 
52  virtual void PacketEvent(const char *slave, const char *slavename, const char *filename,
53  Long64_t eventsprocessed, Double_t latency,
54  Double_t proctime, Double_t cputime,
55  Long64_t bytesRead) = 0;
56 
57  virtual void FileEvent(const char *slave, const char *slavename, const char *nodename,
58  const char *filename, Bool_t isStart) = 0;
59 
60  virtual void FileOpenEvent(TFile *file, const char *filename, Double_t start) = 0;
61 
62  virtual void FileReadEvent(TFile *file, Int_t len, Double_t start) = 0;
63 
64  virtual void UnzipEvent(TObject *tree, Long64_t pos, Double_t start, Int_t complen, Int_t objlen) = 0;
65 
66  virtual void RateEvent(Double_t proctime, Double_t deltatime,
67  Long64_t eventsprocessed, Long64_t bytesRead) = 0;
68 
69  virtual void SetBytesRead(Long64_t num) = 0;
70  virtual Long64_t GetBytesRead() const = 0;
71  virtual void SetNumEvents(Long64_t num) = 0;
72  virtual Long64_t GetNumEvents() const = 0;
73 
74  virtual void PrintBasketInfo(Option_t *option = "") const = 0;
75  virtual void SetLoaded(TBranch *b, size_t basketNumber) = 0;
76  virtual void SetLoaded(size_t bi, size_t basketNumber) = 0;
77  virtual void SetLoadedMiss(TBranch *b, size_t basketNumber) = 0;
78  virtual void SetLoadedMiss(size_t bi, size_t basketNumber) = 0;
79  virtual void SetMissed(TBranch *b, size_t basketNumber) = 0;
80  virtual void SetMissed(size_t bi, size_t basketNumber) = 0;
81  virtual void SetUsed(TBranch *b, size_t basketNumber) = 0;
82  virtual void SetUsed(size_t bi, size_t basketNumber) = 0;
83  virtual void UpdateBranchIndices(TObjArray *branches) = 0;
84 
85  static const char *EventType(EEventType type);
86 
87  ClassDef(TVirtualPerfStats,0) // ABC for collecting PROOF statistics
88 };
89 
90 
91 #ifndef __CINT__
92 #define gPerfStats (TVirtualPerfStats::CurrentPerfStats())
93 
94 #elif defined(__MAKECINT__)
95 // To properly handle the use of gPerfStats in header files (in static declarations)
97 #endif
98 
99 
100 #endif
TVirtualPerfStats::SetLoadedMiss
virtual void SetLoadedMiss(size_t bi, size_t basketNumber)=0
TVirtualPerfStats::FileEvent
virtual void FileEvent(const char *slave, const char *slavename, const char *nodename, const char *filename, Bool_t isStart)=0
TObjArray
An array of TObjects.
Definition: TObjArray.h:37
Option_t
const char Option_t
Definition: RtypesCore.h:66
TVirtualPerfStats::SetLoaded
virtual void SetLoaded(size_t bi, size_t basketNumber)=0
tree
Definition: tree.py:1
TVirtualPerfStats::GetBytesRead
virtual Long64_t GetBytesRead() const =0
TVirtualPerfStats::RateEvent
virtual void RateEvent(Double_t proctime, Double_t deltatime, Long64_t eventsprocessed, Long64_t bytesRead)=0
TVirtualPerfStats::UnzipEvent
virtual void UnzipEvent(TObject *tree, Long64_t pos, Double_t start, Int_t complen, Int_t objlen)=0
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TVirtualPerfStats::kNumEventType
@ kNumEventType
Definition: TVirtualPerfStats.h:45
TVirtualPerfStats
Provides the interface for the PROOF internal performance measurement and event tracing.
Definition: TVirtualPerfStats.h:31
TVirtualPerfStats::~TVirtualPerfStats
virtual ~TVirtualPerfStats()
Definition: TVirtualPerfStats.h:34
TVirtualPerfStats::SetLoaded
virtual void SetLoaded(TBranch *b, size_t basketNumber)=0
TVirtualPerfStats::kRate
@ kRate
Definition: TVirtualPerfStats.h:44
TVirtualPerfStats::EventType
static const char * EventType(EEventType type)
Return the name of the event type.
Definition: TVirtualPerfStats.cxx:54
TVirtualPerfStats::EEventType
EEventType
Definition: TVirtualPerfStats.h:36
TVirtualPerfStats::kPacket
@ kPacket
Definition: TVirtualPerfStats.h:38
b
#define b(i)
Definition: RSha256.hxx:100
TVirtualPerfStats::PacketEvent
virtual 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)=0
bool
TVirtualPerfStats::SetUsed
virtual void SetUsed(size_t bi, size_t basketNumber)=0
TVirtualPerfStats::kFileRead
@ kFileRead
Definition: TVirtualPerfStats.h:43
TBranch
A TTree is a list of TBranches.
Definition: TBranch.h:89
TVirtualPerfStats::kFile
@ kFile
Definition: TVirtualPerfStats.h:41
TVirtualPerfStats::PrintBasketInfo
virtual void PrintBasketInfo(Option_t *option="") const =0
TVirtualPerfStats::SimpleEvent
virtual void SimpleEvent(EEventType type)=0
TVirtualPerfStats::kStart
@ kStart
Definition: TVirtualPerfStats.h:39
TVirtualPerfStats::SetBytesRead
virtual void SetBytesRead(Long64_t num)=0
TVirtualPerfStats::GetNumEvents
virtual Long64_t GetNumEvents() const =0
TVirtualPerfStats::kFileOpen
@ kFileOpen
Definition: TVirtualPerfStats.h:42
TFile
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:54
TVirtualPerfStats::UpdateBranchIndices
virtual void UpdateBranchIndices(TObjArray *branches)=0
Double_t
double Double_t
Definition: RtypesCore.h:59
TObject.h
file
Definition: file.py:1
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TVirtualPerfStats::FileReadEvent
virtual void FileReadEvent(TFile *file, Int_t len, Double_t start)=0
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TVirtualPerfStats::SetMissed
virtual void SetMissed(size_t bi, size_t basketNumber)=0
TVirtualPerfStats::kUnDefined
@ kUnDefined
Definition: TVirtualPerfStats.h:37
R__EXTERN
#define R__EXTERN
Definition: DllImport.h:27
TVirtualPerfStats::SetLoadedMiss
virtual void SetLoadedMiss(TBranch *b, size_t basketNumber)=0
type
int type
Definition: TGX11.cxx:121
TVirtualPerfStats::FileOpenEvent
virtual void FileOpenEvent(TFile *file, const char *filename, Double_t start)=0
TVirtualPerfStats::SetNumEvents
virtual void SetNumEvents(Long64_t num)=0
TVirtualPerfStats::SetMissed
virtual void SetMissed(TBranch *b, size_t basketNumber)=0
gPerfStats
#define gPerfStats
Definition: TVirtualPerfStats.h:92
TVirtualPerfStats::CurrentPerfStats
static TVirtualPerfStats *& CurrentPerfStats()
Return the current ROOT perf stats if any.
Definition: TVirtualPerfStats.cxx:41
TVirtualPerfStats::kStop
@ kStop
Definition: TVirtualPerfStats.h:40
int
TVirtualPerfStats::SetUsed
virtual void SetUsed(TBranch *b, size_t basketNumber)=0