Logo ROOT   6.08/07
Reference Guide
TProofProgressStatus.h
Go to the documentation of this file.
1 // @(#)root/proof:$Id$
2 // Author: Jan Iwaszkiewicz 08/08/08
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2008, 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_TProofProgressStatus
13 #define ROOT_TProofProgressStatus
14 
15 #ifndef ROOT_TObject
16 #include "TObject.h"
17 #endif
18 
19 //////////////////////////////////////////////////////////////////////////
20 // //
21 // TProofProgressStatus //
22 // //
23 // Small class including processing statistics //
24 // //
25 //////////////////////////////////////////////////////////////////////////
26 
27 class TProofProgressStatus : public TObject {
28 public:
31  };
32 private:
33  Long64_t fLastEntries; // Last chunck
37  Double_t fLearnTime; // the time spent in learning phase
38  Double_t fLastProcTime; // the wallclock time of the last addition
39  Double_t fProcTime; // the wallclock time
41  Double_t fLastUpdate; // Timestamp of last change
42 public:
43  TProofProgressStatus(Long64_t fEntries = 0, Long64_t fBytesRead = 0,
44  Long64_t fReadCalls = 0,
45  Double_t fProcTime = 0, Double_t fCPUTime = 0);
46  void Reset() { fEntries = 0,
47  fBytesRead = 0, fProcTime = 0, fCPUTime = 0; SetLastUpdate();}
48 
49  inline Long64_t GetEntries() const { return fEntries; }
50  inline Long64_t GetBytesRead() const { return fBytesRead; }
51  inline Long64_t GetReadCalls() const { return fReadCalls; }
52  inline Double_t GetLearnTime() const { return fLearnTime; }
53  inline Double_t GetProcTime() const { return fProcTime; }
54  inline Double_t GetCPUTime() const { return fCPUTime; }
55  inline Double_t GetLastUpdate() const { return fLastUpdate; }
56  inline Double_t GetRate() const { return ((fProcTime > 0) ? fEntries/fProcTime : 0); }
57  Double_t GetCurrentRate() const;
58  inline void SetLastEntries(Long64_t entries) { fLastEntries = entries; }
59  inline void SetEntries(Long64_t entries) { fEntries = entries; }
60  inline void IncEntries(Long64_t entries = 1) { fLastEntries = entries; fEntries += entries; }
61  inline void IncBytesRead(Long64_t bytesRead) { fBytesRead += bytesRead; }
62  inline void SetBytesRead(Long64_t bytesRead) { fBytesRead = bytesRead; }
63  inline void IncReadCalls(Long64_t readCalls) { fReadCalls += readCalls; }
64  inline void SetReadCalls(Long64_t readCalls) { fReadCalls = readCalls; }
65  inline void SetLearnTime(Double_t learnTime) { fLearnTime = learnTime; }
66  inline void SetLastProcTime(Double_t procTime) { fLastProcTime = procTime; }
67  inline void SetProcTime(Double_t procTime) { fProcTime = procTime; }
68  inline void IncProcTime(Double_t procTime) { fLastProcTime = procTime; fProcTime += procTime; }
69  inline void SetCPUTime(Double_t procTime) { fCPUTime = procTime; }
70  inline void IncCPUTime(Double_t procTime) { fCPUTime += procTime; }
71  void SetLastUpdate(Double_t updtTime = 0);
72  void Print(Option_t* option = "") const;
73 
77 
78  ClassDef(TProofProgressStatus,2) // Proof progress status class
79 };
80 
81 #endif
void IncCPUTime(Double_t procTime)
long long Long64_t
Definition: RtypesCore.h:69
const char Option_t
Definition: RtypesCore.h:62
#define BIT(n)
Definition: Rtypes.h:120
Double_t GetProcTime() const
void SetLastUpdate(Double_t updtTime=0)
Update time stamp either with the passed value (if > 0) or with the current time. ...
void IncProcTime(Double_t procTime)
void SetReadCalls(Long64_t readCalls)
Long64_t GetEntries() const
void Print(Option_t *option="") const
Dump the content.
Double_t GetLastUpdate() const
Double_t GetLearnTime() const
void SetProcTime(Double_t procTime)
#define ClassDef(name, id)
Definition: Rtypes.h:254
void IncEntries(Long64_t entries=1)
void IncBytesRead(Long64_t bytesRead)
Double_t GetRate() const
void SetBytesRead(Long64_t bytesRead)
void IncReadCalls(Long64_t readCalls)
Double_t GetCurrentRate() const
Get current rate. Rteunr the average rate if the current is not defined.
void SetLastEntries(Long64_t entries)
void SetLearnTime(Double_t learnTime)
TProofProgressStatus(Long64_t fEntries=0, Long64_t fBytesRead=0, Long64_t fReadCalls=0, Double_t fProcTime=0, Double_t fCPUTime=0)
Main and default constructor.
void SetLastProcTime(Double_t procTime)
double Double_t
Definition: RtypesCore.h:55
void SetEntries(Long64_t entries)
Double_t GetCPUTime() const
EStatusBits
Definition: TObject.h:55
Long64_t GetReadCalls() const
Mother of all ROOT objects.
Definition: TObject.h:37
Long64_t GetBytesRead() const
TProofProgressStatus operator-(TProofProgressStatus &st)
'-' operator
TProofProgressStatus & operator+=(const TProofProgressStatus &st)
'+=' operator
Container class for processing statistics.
void SetCPUTime(Double_t procTime)
TProofProgressStatus & operator-=(const TProofProgressStatus &st)
'-=' operator