]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/util/AliHLTComponentBenchmark.h
extra benchmarks are added
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTComponentBenchmark.h
1 //-*- Mode: C++ -*-
2 // ************************************************************************
3 // This file is property of and copyright by the ALICE HLT Project        *
4 // ALICE Experiment at CERN, All rights reserved.                         *
5 // See cxx source for full Copyright notice                               *
6 //                                                                        *
7 //*************************************************************************
8
9
10 #ifndef ALIHLTCOMPONENTBENCHMARK_H
11 #define ALIHLTCOMPONENTBENCHMARK_H
12
13 #include "TStopwatch.h"
14 #include "TString.h"
15
16 /**
17  * @class AliHLTComponentBenchmark
18  *
19  * AliHLTComponentBenchmark can be used to benchmark HLT compnoents
20  */
21 class AliHLTComponentBenchmark
22 {
23   public:
24
25   AliHLTComponentBenchmark( const char *Name="" );
26   ~AliHLTComponentBenchmark(){}
27
28   void Reset();
29   void SetName( const char *Name );
30   void SetTimer( Int_t i, const char *Name );
31   void StartNewEvent();
32   void Start( Int_t i );
33   void Stop( Int_t i );
34   void AddInput( Double_t x );
35   void AddOutput( Double_t x );
36   const char *GetStatistics();
37
38   private:
39
40   TString fComponentName;// name of the component
41   Int_t fNTimers; // n of timers
42   TStopwatch fTimers[10]; // the timers
43   TString fNames[10]; // timer names
44   ULong_t fNEvents; // N events processed
45   Double_t fTotalRealTime[10]; // total real time
46   Double_t fTotalCPUTime[10]; // total CPU time
47   Double_t fTotalInput; // total input size
48   Double_t fTotalOutput; // total output size
49   TString fStatistics;// string with statistics
50 };
51
52 #endif