Logo ROOT  
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 #include "TObject.h"
16 
17 //////////////////////////////////////////////////////////////////////////
18 // //
19 // TProofProgressStatus //
20 // //
21 // Small class including processing statistics //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 class TProofProgressStatus : public TObject {
26 public:
28  kFileCorrupted = BIT(16)
29  };
30 private:
31  Long64_t fLastEntries; // Last chunck
35  Double_t fLearnTime; // the time spent in learning phase
36  Double_t fLastProcTime; // the wallclock time of the last addition
37  Double_t fProcTime; // the wallclock time
39  Double_t fLastUpdate; // Timestamp of last change
40 public:
42  Long64_t fReadCalls = 0,
44  void Reset() { fEntries = 0,
45  fBytesRead = 0, fProcTime = 0, fCPUTime = 0; SetLastUpdate();}
46 
47  inline Long64_t GetEntries() const { return fEntries; }
48  inline Long64_t GetBytesRead() const { return fBytesRead; }
49  inline Long64_t GetReadCalls() const { return fReadCalls; }
50  inline Double_t GetLearnTime() const { return fLearnTime; }
51  inline Double_t GetProcTime() const { return fProcTime; }
52  inline Double_t GetCPUTime() const { return fCPUTime; }
53  inline Double_t GetLastUpdate() const { return fLastUpdate; }
54  inline Double_t GetRate() const { return ((fProcTime > 0) ? fEntries/fProcTime : 0); }
55  Double_t GetCurrentRate() const;
56  inline void SetLastEntries(Long64_t entries) { fLastEntries = entries; }
57  inline void SetEntries(Long64_t entries) { fEntries = entries; }
58  inline void IncEntries(Long64_t entries = 1) { fLastEntries = entries; fEntries += entries; }
59  inline void IncBytesRead(Long64_t bytesRead) { fBytesRead += bytesRead; }
60  inline void SetBytesRead(Long64_t bytesRead) { fBytesRead = bytesRead; }
61  inline void IncReadCalls(Long64_t readCalls) { fReadCalls += readCalls; }
62  inline void SetReadCalls(Long64_t readCalls) { fReadCalls = readCalls; }
63  inline void SetLearnTime(Double_t learnTime) { fLearnTime = learnTime; }
64  inline void SetLastProcTime(Double_t procTime) { fLastProcTime = procTime; }
65  inline void SetProcTime(Double_t procTime) { fProcTime = procTime; }
66  inline void IncProcTime(Double_t procTime) { fLastProcTime = procTime; fProcTime += procTime; }
67  inline void SetCPUTime(Double_t procTime) { fCPUTime = procTime; }
68  inline void IncCPUTime(Double_t procTime) { fCPUTime += procTime; }
69  void SetLastUpdate(Double_t updtTime = 0);
70  void Print(Option_t* option = "") const;
71 
75 
76  ClassDef(TProofProgressStatus,2) // Proof progress status class
77 };
78 
79 #endif
TProofProgressStatus::fLastEntries
Long64_t fLastEntries
Definition: TProofProgressStatus.h:31
TProofProgressStatus::fCPUTime
Double_t fCPUTime
Definition: TProofProgressStatus.h:38
TProofProgressStatus::operator-=
TProofProgressStatus & operator-=(const TProofProgressStatus &st)
'-=' operator
Definition: TProofProgressStatus.cxx:68
TProofProgressStatus::IncBytesRead
void IncBytesRead(Long64_t bytesRead)
Definition: TProofProgressStatus.h:59
TProofProgressStatus::GetEntries
Long64_t GetEntries() const
Definition: TProofProgressStatus.h:47
TProofProgressStatus::SetEntries
void SetEntries(Long64_t entries)
Definition: TProofProgressStatus.h:57
TProofProgressStatus::SetCPUTime
void SetCPUTime(Double_t procTime)
Definition: TProofProgressStatus.h:67
Option_t
const char Option_t
Definition: RtypesCore.h:66
TProofProgressStatus::IncReadCalls
void IncReadCalls(Long64_t readCalls)
Definition: TProofProgressStatus.h:61
TProofProgressStatus::fLastUpdate
Double_t fLastUpdate
Definition: TProofProgressStatus.h:39
TProofProgressStatus::GetCPUTime
Double_t GetCPUTime() const
Definition: TProofProgressStatus.h:52
TProofProgressStatus::GetReadCalls
Long64_t GetReadCalls() const
Definition: TProofProgressStatus.h:49
Long64_t
long long Long64_t
Definition: RtypesCore.h:80
TProofProgressStatus::fProcTime
Double_t fProcTime
Definition: TProofProgressStatus.h:37
TProofProgressStatus::IncCPUTime
void IncCPUTime(Double_t procTime)
Definition: TProofProgressStatus.h:68
TProofProgressStatus::operator+=
TProofProgressStatus & operator+=(const TProofProgressStatus &st)
'+=' operator
Definition: TProofProgressStatus.cxx:50
TProofProgressStatus::SetReadCalls
void SetReadCalls(Long64_t readCalls)
Definition: TProofProgressStatus.h:62
TProofProgressStatus::GetProcTime
Double_t GetProcTime() const
Definition: TProofProgressStatus.h:51
TProofProgressStatus::fLearnTime
Double_t fLearnTime
Definition: TProofProgressStatus.h:35
TProofProgressStatus::operator-
TProofProgressStatus operator-(TProofProgressStatus &st)
'-' operator
Definition: TProofProgressStatus.cxx:84
TProofProgressStatus::SetLastUpdate
void SetLastUpdate(Double_t updtTime=0)
Update time stamp either with the passed value (if > 0) or with the current time.
Definition: TProofProgressStatus.cxx:104
TProofProgressStatus::IncProcTime
void IncProcTime(Double_t procTime)
Definition: TProofProgressStatus.h:66
TProofProgressStatus::fReadCalls
Long64_t fReadCalls
Definition: TProofProgressStatus.h:34
TProofProgressStatus::GetLastUpdate
Double_t GetLastUpdate() const
Definition: TProofProgressStatus.h:53
TProofProgressStatus::GetLearnTime
Double_t GetLearnTime() const
Definition: TProofProgressStatus.h:50
TProofProgressStatus
Container class for processing statistics.
Definition: TProofProgressStatus.h:25
TProofProgressStatus::SetLastProcTime
void SetLastProcTime(Double_t procTime)
Definition: TProofProgressStatus.h:64
TProofProgressStatus::SetProcTime
void SetProcTime(Double_t procTime)
Definition: TProofProgressStatus.h:65
TProofProgressStatus::GetRate
Double_t GetRate() const
Definition: TProofProgressStatus.h:54
TProofProgressStatus::IncEntries
void IncEntries(Long64_t entries=1)
Definition: TProofProgressStatus.h:58
TProofProgressStatus::SetLastEntries
void SetLastEntries(Long64_t entries)
Definition: TProofProgressStatus.h:56
BIT
#define BIT(n)
Definition: Rtypes.h:85
TProofProgressStatus::Print
void Print(Option_t *option="") const
Dump the content.
Definition: TProofProgressStatus.cxx:92
TProofProgressStatus::SetBytesRead
void SetBytesRead(Long64_t bytesRead)
Definition: TProofProgressStatus.h:60
TProofProgressStatus::fEntries
Long64_t fEntries
Definition: TProofProgressStatus.h:32
TProofProgressStatus::fLastProcTime
Double_t fLastProcTime
Definition: TProofProgressStatus.h:36
Double_t
double Double_t
Definition: RtypesCore.h:59
TObject.h
TProofProgressStatus::kFileNotOpen
@ kFileNotOpen
Definition: TProofProgressStatus.h:27
TProofProgressStatus::kFileCorrupted
@ kFileCorrupted
Definition: TProofProgressStatus.h:28
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TProofProgressStatus::Reset
void Reset()
Definition: TProofProgressStatus.h:44
TProofProgressStatus::fBytesRead
Long64_t fBytesRead
Definition: TProofProgressStatus.h:33
TProofProgressStatus::GetBytesRead
Long64_t GetBytesRead() const
Definition: TProofProgressStatus.h:48
TProofProgressStatus::GetCurrentRate
Double_t GetCurrentRate() const
Get current rate. Rteunr the average rate if the current is not defined.
Definition: TProofProgressStatus.cxx:117
TProofProgressStatus::TProofProgressStatus
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.
Definition: TProofProgressStatus.cxx:30
TProofProgressStatus::SetLearnTime
void SetLearnTime(Double_t learnTime)
Definition: TProofProgressStatus.h:63
TObject::EStatusBits
EStatusBits
Definition: TObject.h:57