Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:34

0001 // @(#)root/base:$Id$
0002 // Author: Kristjan Gulbrandsen   11/05/04
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TVirtualPerfStats
0013 #define ROOT_TVirtualPerfStats
0014 
0015 //////////////////////////////////////////////////////////////////////////
0016 //                                                                      //
0017 // TVirtualPerfStats                                                    //
0018 //                                                                      //
0019 // Provides the interface for the PROOF internal performance measurment //
0020 // and event tracing.                                                   //
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,       //info of single packet processing
0045       kStart,        //begin of run
0046       kStop,         //end of run
0047       kFile,         //file started/finished in packetizer
0048       kFileOpen,     //opening data file statistics
0049       kFileRead,     //reading data file event
0050       kRate,         //processing {evt, MB} rates
0051       kNumEventType  //number of entries, must be last
0052    };
0053 
0054    static TVirtualPerfStats *&CurrentPerfStats();  // Return the current perfStats for this thread.
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)  // ABC for collecting PROOF statistics
0094 };
0095 
0096 #define gPerfStats (TVirtualPerfStats::CurrentPerfStats())
0097 
0098 #endif