steadystate: get rid of ->ss_pct and encode this information in ->state via __FIO_SS_PCT
[fio.git] / steadystate.h
CommitLineData
16e56d25
VF
1#ifndef FIO_STEADYSTATE_H
2#define FIO_STEADYSTATE_H
3
4cd5b75b
JA
4#include "thread_options.h"
5
16e56d25
VF
6extern void steadystate_check(void);
7extern void steadystate_setup(void);
56a90eba 8extern int td_steadystate_init(struct thread_data *);
4cd5b75b 9
84784e07 10extern bool steadystate_enabled;
0a70e050
JA
11
12/*
13 * For steady state detection
14 */
15struct steadystate_data {
16 double limit;
17 unsigned long long dur;
18 unsigned long long ramp_time;
0a70e050 19
5b4b6586 20 unsigned int state;
0a70e050
JA
21
22 unsigned int head;
23 unsigned int tail;
24 unsigned long *iops_data;
25 unsigned long *bw_data;
26
27 double slope;
28 double criterion;
29 double deviation;
30
31 unsigned long long sum_y;
32 unsigned long long sum_x;
33 unsigned long long sum_x_sq;
34 unsigned long long sum_xy;
35 unsigned long long oldest_y;
36
37 struct timeval prev_time;
38 unsigned long long prev_iops;
39 unsigned long long prev_bytes;
40};
41
4cd5b75b 42enum {
ad743db4
JA
43 __FIO_SS_IOPS = 1,
44 __FIO_SS_BW = 2,
45 __FIO_SS_SLOPE = 4,
46 __FIO_SS_ATTAINED = 8,
5b4b6586 47 __FIO_SS_RAMP_OVER = 16,
ec55e631 48 __FIO_SS_DATA = 32,
e6a6a984 49 __FIO_SS_PCT = 64,
f0c50c66
JA
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,
4cd5b75b
JA
55};
56
84784e07
JA
57#define STEADYSTATE_MSEC 1000
58
16e56d25 59#endif