00001 // @(#)root/proof:$Id: TProofProgressStatus.h 30859 2009-10-24 14:53:07Z ganis $ 00002 // Author: Jan Iwaszkiewicz 08/08/08 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TProofProgressStatus 00013 #define ROOT_TProofProgressStatus 00014 00015 #ifndef ROOT_TObject 00016 #include "TObject.h" 00017 #endif 00018 00019 ////////////////////////////////////////////////////////////////////////// 00020 // // 00021 // TProofProgressStatus // 00022 // // 00023 // Small class including processing statistics // 00024 // // 00025 ////////////////////////////////////////////////////////////////////////// 00026 00027 class TProofProgressStatus : public TObject { 00028 private: 00029 Long64_t fLastEntries; // Last chunck 00030 Long64_t fEntries; 00031 Long64_t fBytesRead; 00032 Long64_t fReadCalls; 00033 Double_t fLearnTime; // the time spent in learning phase 00034 Double_t fLastProcTime; // the wallclock time of the last addition 00035 Double_t fProcTime; // the wallclock time 00036 Double_t fCPUTime; 00037 Double_t fLastUpdate; // Timestamp of last change 00038 public: 00039 TProofProgressStatus(Long64_t fEntries = 0, Long64_t fBytesRead = 0, 00040 Long64_t fReadCalls = 0, 00041 Double_t fProcTime = 0, Double_t fCPUTime = 0); 00042 void Reset() { fEntries = 0, 00043 fBytesRead = 0, fProcTime = 0, fCPUTime = 0; SetLastUpdate();} 00044 00045 Long64_t GetEntries() const { return fEntries; } 00046 Long64_t GetBytesRead() const { return fBytesRead; } 00047 Long64_t GetReadCalls() const { return fReadCalls; } 00048 Double_t GetLearnTime() const { return fLearnTime; } 00049 Double_t GetProcTime() const { return fProcTime; } 00050 Double_t GetCPUTime() const { return fCPUTime; } 00051 Double_t GetLastUpdate() const { return fLastUpdate; } 00052 Double_t GetRate() const { return ((fProcTime > 0) ? fEntries/fProcTime : 0); } 00053 Double_t GetCurrentRate() const; 00054 void SetLastEntries(Long64_t entries) { fLastEntries = entries;} 00055 void SetEntries(Long64_t entries) { fEntries = entries; SetLastUpdate();} 00056 void IncEntries(Long64_t entries = 1) { fLastEntries = entries; fEntries += entries; SetLastUpdate();} 00057 void IncBytesRead(Long64_t bytesRead) { fBytesRead += bytesRead; SetLastUpdate();} 00058 void SetBytesRead(Long64_t bytesRead) { fBytesRead = bytesRead; SetLastUpdate();} 00059 void IncReadCalls(Long64_t readCalls) { fReadCalls += readCalls; SetLastUpdate();} 00060 void SetReadCalls(Long64_t readCalls) { fReadCalls = readCalls; SetLastUpdate();} 00061 void SetLearnTime(Double_t learnTime) { fLearnTime = learnTime; } 00062 void SetLastProcTime(Double_t procTime) { fLastProcTime = procTime; } 00063 void SetProcTime(Double_t procTime) { fProcTime = procTime; } 00064 void IncProcTime(Double_t procTime) { fLastProcTime = procTime; fProcTime += procTime; } 00065 void SetCPUTime(Double_t procTime) { fCPUTime = procTime; } 00066 void IncCPUTime(Double_t procTime) { fCPUTime += procTime; } 00067 void SetLastUpdate(Double_t updtTime = 0); 00068 void Print(Option_t* option = "") const; 00069 00070 TProofProgressStatus operator-(TProofProgressStatus &st); 00071 TProofProgressStatus &operator+=(const TProofProgressStatus &st); 00072 TProofProgressStatus &operator-=(const TProofProgressStatus &st); 00073 00074 ClassDef(TProofProgressStatus,2) // Proof progress status class 00075 }; 00076 00077 #endif