Statistics
| Branch: | Revision:

root / synthbench / bonnie++ / .svn / text-base / bon_time.h.svn-base @ 0:839f52ef7657

History | View | Annotate | Download (1.2 kB)

1
#ifndef BON_TIME_H
2
#define BON_TIME_H
3

    
4
#include "bonnie.h"
5

    
6
struct report_s
7
{
8
  double CPU;
9
  double StartTime;
10
  double EndTime;
11
};
12

    
13
struct delta_s
14
{
15
  double CPU;
16
  double Elapsed;
17
  double FirstStart;
18
  double LastStop;
19
};
20

    
21
class BonTimer
22
{
23
public:
24
  enum RepType { csv, txt };
25

    
26
  BonTimer();
27

    
28
  void timestamp();
29
  void get_delta_t(tests_t test);
30
  void get_delta_report(report_s &rep);
31
  void add_delta_report(report_s &rep, tests_t test);
32
  int DoReport(CPCCHAR machine, int size, int directory_size
33
             , int max_size, int min_size, int num_directories
34
             , int chunk_size, FILE *fp);
35
  void SetType(RepType type) { m_type = type; }
36
  double cpu_so_far();
37
  double time_so_far();
38
  void PrintHeader(FILE *fp);
39
  void Initialize();
40
  static double get_cur_time();
41
  static double get_cpu_use();
42
 
43
private:
44
  int print_cpu_stat(tests_t test);
45
  int print_stat(tests_t test);
46
  int print_file_stat(tests_t test);
47

    
48
  delta_s m_delta[TestCount];
49
  double m_last_cpustamp;
50
  double m_last_timestamp;
51
  RepType m_type;
52
  int m_file_size;
53
  int m_directory_size;
54
  int m_chunk_size;
55
  FILE *m_fp;
56

    
57
  BonTimer(const BonTimer&);
58
  BonTimer &operator=(const BonTimer&);
59
};
60

    
61
#endif