Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TProofProgressStatus.cxx
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/** \class TProofProgressStatus
13\ingroup proofkernel
14
15Container class for processing statistics
16
17*/
18
20#include "TObject.h"
21#include "TString.h"
22#include "TSystem.h"
23#include "TTime.h"
24
26
27////////////////////////////////////////////////////////////////////////////////
28/// Main and default constructor
29
31 Long64_t bytesRead,
32 Long64_t readCalls,
33 Double_t procTime,
34 Double_t cpuTime): TObject()
35{
36 fLastEntries = 0;
37 fEntries = entries;
38 fBytesRead = bytesRead;
39 fReadCalls = readCalls;
40 fLearnTime = 0.;
41 fLastProcTime = 0;
42 fProcTime = procTime;
43 fCPUTime = cpuTime;
45}
46
47////////////////////////////////////////////////////////////////////////////////
48/// '+=' operator
49
51{
53 fEntries += st.fEntries;
56 if (st.fLearnTime > fLearnTime)
59 fProcTime += st.fProcTime;
60 fCPUTime += st.fCPUTime;
62 return *this;
63}
64
65////////////////////////////////////////////////////////////////////////////////
66/// '-=' operator
67
69{
70 fEntries -= st.fEntries;
73 if (st.fLearnTime < fLearnTime)
75 fProcTime -= st.fProcTime;
76 fCPUTime -= st.fCPUTime;
78 return *this;
79}
80
81////////////////////////////////////////////////////////////////////////////////
82/// '-' operator
83
85{
86 return TProofProgressStatus(*this) -= st;
87}
88
89////////////////////////////////////////////////////////////////////////////////
90/// Dump the content
91
93{
94 Printf("TProofProgressStatus:%s: Ents:(%lld,%lld), Bytes:%lld, Calls:%lld,"
95 " Learn:%.3g s, Proc:(%.3g,%.3g) s, CPU:%.3g s",
98}
99
100////////////////////////////////////////////////////////////////////////////////
101/// Update time stamp either with the passed value (if > 0) or with
102/// the current time
103
105{
106 if (updtTime > 0) {
107 fLastUpdate = updtTime;
108 } else {
109 TTime tnow = gSystem->Now();
110 fLastUpdate = (Double_t) (Long64_t(tnow)) / (Double_t)1000.;
111 }
112}
113
114////////////////////////////////////////////////////////////////////////////////
115/// Get current rate. Rteunr the average rate if the current is not defined
116
118{
119 if (fLastProcTime > 0) {
121 }
122 return GetRate();
123}
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:80
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:377
Option_t Option_t option
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
Definition TString.cxx:2481
R__EXTERN TSystem * gSystem
Definition TSystem.h:560
Mother of all ROOT objects.
Definition TObject.h:41
Container class for processing statistics.
void SetLastUpdate(Double_t updtTime=0)
Update time stamp either with the passed value (if > 0) or with the current time.
void Print(Option_t *option="") const
Dump the content.
TProofProgressStatus & operator-=(const TProofProgressStatus &st)
'-=' operator
TProofProgressStatus operator-(TProofProgressStatus &st)
'-' operator
TProofProgressStatus & operator+=(const TProofProgressStatus &st)
'+=' operator
Double_t GetCurrentRate() const
Get current rate. Rteunr the average rate if the current is not defined.
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.
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
Definition TSystem.cxx:466
Basic time type with millisecond precision.
Definition TTime.h:27