-
Notifications
You must be signed in to change notification settings - Fork 1
/
bon_time.h
61 lines (51 loc) · 1.17 KB
/
bon_time.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef BON_TIME_H
#define BON_TIME_H
#include "bonnie.h"
struct report_s
{
double CPU;
double StartTime;
double EndTime;
};
struct delta_s
{
double CPU;
double Elapsed;
double FirstStart;
double LastStop;
};
class BonTimer
{
public:
enum RepType { csv, txt };
BonTimer();
void timestamp();
void get_delta_t(tests_t test);
void get_delta_report(report_s &rep);
void add_delta_report(report_s &rep, tests_t test);
int DoReport(CPCCHAR machine, int size, int directory_size
, int max_size, int min_size, int num_directories
, int chunk_size, FILE *fp);
void SetType(RepType type) { m_type = type; }
double cpu_so_far();
double time_so_far();
void PrintHeader(FILE *fp);
void Initialize();
static double get_cur_time();
static double get_cpu_use();
private:
int print_cpu_stat(tests_t test);
int print_stat(tests_t test);
int print_file_stat(tests_t test);
delta_s m_delta[TestCount];
double m_last_cpustamp;
double m_last_timestamp;
RepType m_type;
int m_file_size;
int m_directory_size;
int m_chunk_size;
FILE *m_fp;
BonTimer(const BonTimer&);
BonTimer &operator=(const BonTimer&);
};
#endif