File indexing completed on 2025-01-18 10:12:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TVirtualPerfStats
0013 #define ROOT_TVirtualPerfStats
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #include "TObject.h"
0026
0027
0028 class TFile;
0029 class TBranch;
0030 class TChain;
0031
0032 class TVirtualPerfStats : public TObject {
0033
0034 private:
0035 friend class TChain;
0036
0037 virtual void SetFile(TFile *) = 0;
0038
0039 public:
0040 virtual ~TVirtualPerfStats() {}
0041
0042 enum EEventType {
0043 kUnDefined,
0044 kPacket,
0045 kStart,
0046 kStop,
0047 kFile,
0048 kFileOpen,
0049 kFileRead,
0050 kRate,
0051 kNumEventType
0052 };
0053
0054 static TVirtualPerfStats *&CurrentPerfStats();
0055
0056 virtual void SimpleEvent(EEventType type) = 0;
0057
0058 virtual void PacketEvent(const char *slave, const char *slavename, const char *filename,
0059 Long64_t eventsprocessed, Double_t latency,
0060 Double_t proctime, Double_t cputime,
0061 Long64_t bytesRead) = 0;
0062
0063 virtual void FileEvent(const char *slave, const char *slavename, const char *nodename,
0064 const char *filename, Bool_t isStart) = 0;
0065
0066 virtual void FileOpenEvent(TFile *file, const char *filename, Double_t start) = 0;
0067
0068 virtual void FileReadEvent(TFile *file, Int_t len, Double_t start) = 0;
0069
0070 virtual void UnzipEvent(TObject *tree, Long64_t pos, Double_t start, Int_t complen, Int_t objlen) = 0;
0071
0072 virtual void RateEvent(Double_t proctime, Double_t deltatime,
0073 Long64_t eventsprocessed, Long64_t bytesRead) = 0;
0074
0075 virtual void SetBytesRead(Long64_t num) = 0;
0076 virtual Long64_t GetBytesRead() const = 0;
0077 virtual void SetNumEvents(Long64_t num) = 0;
0078 virtual Long64_t GetNumEvents() const = 0;
0079
0080 virtual void PrintBasketInfo(Option_t *option = "") const = 0;
0081 virtual void SetLoaded(TBranch *b, size_t basketNumber) = 0;
0082 virtual void SetLoaded(size_t bi, size_t basketNumber) = 0;
0083 virtual void SetLoadedMiss(TBranch *b, size_t basketNumber) = 0;
0084 virtual void SetLoadedMiss(size_t bi, size_t basketNumber) = 0;
0085 virtual void SetMissed(TBranch *b, size_t basketNumber) = 0;
0086 virtual void SetMissed(size_t bi, size_t basketNumber) = 0;
0087 virtual void SetUsed(TBranch *b, size_t basketNumber) = 0;
0088 virtual void SetUsed(size_t bi, size_t basketNumber) = 0;
0089 virtual void UpdateBranchIndices(TObjArray *branches) = 0;
0090
0091 static const char *EventType(EEventType type);
0092
0093 ClassDefOverride(TVirtualPerfStats,0)
0094 };
0095
0096 #define gPerfStats (TVirtualPerfStats::CurrentPerfStats())
0097
0098 #endif