ROOT logo
//-*- Mode: C++ -*-
// $Id$
// ************************************************************************
// This file is property of and copyright by the ALICE HLT Project        *
// ALICE Experiment at CERN, All rights reserved.                         *
// See cxx source for full Copyright notice                               *
//                                                                        *
//*************************************************************************


#ifndef ALIHLTCOMPONENTBENCHMARK_H
#define ALIHLTCOMPONENTBENCHMARK_H

#include "TStopwatch.h"
#include "TString.h"

/**
 * @class AliHLTComponentBenchmark
 *
 * AliHLTComponentBenchmark can be used to benchmark HLT compnoents
 */
class AliHLTComponentBenchmark
{
  public:

  AliHLTComponentBenchmark( const char *Name="" );
  ~AliHLTComponentBenchmark(){}

  void Reset();
  void SetName( const char *Name );
  void SetTimer( Int_t i, const char *Name );
  void StartNewEvent();
  void Start( Int_t i );
  void Stop( Int_t i );
  void AddInput( Double_t x );
  void AddOutput( Double_t x );
  const char *GetStatistics();
  /**
  *
  * returns satistics:
  * 0: number of events
  * 1: input file size per event
  * 2: output file size per event
  * 3: ratio output/input
  * 4+i: real time per event of counter i
  * 5+i: cpu time per event of counter i
  *
  **/
  void GetStatisticsData(Double_t* statistics, TString* names);

  private:

  TString fComponentName;// name of the component
  Int_t fNTimers; // n of timers
  TStopwatch fTimers[10]; // the timers
  TString fNames[10]; // timer names
  ULong_t fNEvents; // N events processed
  Double_t fTotalRealTime[10]; // total real time
  Double_t fTotalCPUTime[10]; // total CPU time
  Double_t fTotalInput; // total input size
  Double_t fTotalOutput; // total output size
  TString fStatistics;// string with statistics
};

#endif 
 AliHLTComponentBenchmark.h:1
 AliHLTComponentBenchmark.h:2
 AliHLTComponentBenchmark.h:3
 AliHLTComponentBenchmark.h:4
 AliHLTComponentBenchmark.h:5
 AliHLTComponentBenchmark.h:6
 AliHLTComponentBenchmark.h:7
 AliHLTComponentBenchmark.h:8
 AliHLTComponentBenchmark.h:9
 AliHLTComponentBenchmark.h:10
 AliHLTComponentBenchmark.h:11
 AliHLTComponentBenchmark.h:12
 AliHLTComponentBenchmark.h:13
 AliHLTComponentBenchmark.h:14
 AliHLTComponentBenchmark.h:15
 AliHLTComponentBenchmark.h:16
 AliHLTComponentBenchmark.h:17
 AliHLTComponentBenchmark.h:18
 AliHLTComponentBenchmark.h:19
 AliHLTComponentBenchmark.h:20
 AliHLTComponentBenchmark.h:21
 AliHLTComponentBenchmark.h:22
 AliHLTComponentBenchmark.h:23
 AliHLTComponentBenchmark.h:24
 AliHLTComponentBenchmark.h:25
 AliHLTComponentBenchmark.h:26
 AliHLTComponentBenchmark.h:27
 AliHLTComponentBenchmark.h:28
 AliHLTComponentBenchmark.h:29
 AliHLTComponentBenchmark.h:30
 AliHLTComponentBenchmark.h:31
 AliHLTComponentBenchmark.h:32
 AliHLTComponentBenchmark.h:33
 AliHLTComponentBenchmark.h:34
 AliHLTComponentBenchmark.h:35
 AliHLTComponentBenchmark.h:36
 AliHLTComponentBenchmark.h:37
 AliHLTComponentBenchmark.h:38
 AliHLTComponentBenchmark.h:39
 AliHLTComponentBenchmark.h:40
 AliHLTComponentBenchmark.h:41
 AliHLTComponentBenchmark.h:42
 AliHLTComponentBenchmark.h:43
 AliHLTComponentBenchmark.h:44
 AliHLTComponentBenchmark.h:45
 AliHLTComponentBenchmark.h:46
 AliHLTComponentBenchmark.h:47
 AliHLTComponentBenchmark.h:48
 AliHLTComponentBenchmark.h:49
 AliHLTComponentBenchmark.h:50
 AliHLTComponentBenchmark.h:51
 AliHLTComponentBenchmark.h:52
 AliHLTComponentBenchmark.h:53
 AliHLTComponentBenchmark.h:54
 AliHLTComponentBenchmark.h:55
 AliHLTComponentBenchmark.h:56
 AliHLTComponentBenchmark.h:57
 AliHLTComponentBenchmark.h:58
 AliHLTComponentBenchmark.h:59
 AliHLTComponentBenchmark.h:60
 AliHLTComponentBenchmark.h:61
 AliHLTComponentBenchmark.h:62
 AliHLTComponentBenchmark.h:63
 AliHLTComponentBenchmark.h:64
 AliHLTComponentBenchmark.h:65