steadystate: eliminate some steadystate_data members
[fio.git] / steadystate.h
1 #ifndef FIO_STEADYSTATE_H
2 #define FIO_STEADYSTATE_H
3
4 #include "thread_options.h"
5
6 extern void steadystate_check(void);
7 extern void steadystate_setup(void);
8 extern void td_steadystate_init(struct thread_data *);
9
10 extern bool steadystate_enabled;
11
12 /*
13  * For steady state detection
14  */
15 struct steadystate_data {
16         double limit;
17         unsigned long long dur;
18         unsigned long long ramp_time;
19         bool pct;
20
21         unsigned int mode;
22         int attained;
23         int last_in_group;
24         int ramp_time_over;
25
26         unsigned int head;
27         unsigned int tail;
28         unsigned long *iops_data;
29         unsigned long *bw_data;
30
31         double slope;
32         double criterion;
33         double deviation;
34
35         unsigned long long sum_y;
36         unsigned long long sum_x;
37         unsigned long long sum_x_sq;
38         unsigned long long sum_xy;
39         unsigned long long oldest_y;
40
41         struct timeval prev_time;
42         unsigned long long prev_iops;
43         unsigned long long prev_bytes;
44 };
45
46 enum {
47         __FIO_SS_IOPS   = 1,
48         __FIO_SS_BW     = 2,
49         __FIO_SS_SLOPE  = 4,
50
51         FIO_SS_IOPS             = __FIO_SS_IOPS,
52         FIO_SS_IOPS_SLOPE       = __FIO_SS_IOPS | __FIO_SS_SLOPE,
53         FIO_SS_BW               = __FIO_SS_BW,
54         FIO_SS_BW_SLOPE         = __FIO_SS_BW | __FIO_SS_SLOPE,
55 };
56
57 #define STEADYSTATE_MSEC        1000
58
59 #endif