steadystate: implement transmission of steadystate data over the wire in client/serve...
[fio.git] / steadystate.h
CommitLineData
16e56d25
VF
1#ifndef FIO_STEADYSTATE_H
2#define FIO_STEADYSTATE_H
3
bb49c8bd 4#include "stat.h"
4cd5b75b 5#include "thread_options.h"
bb49c8bd 6#include "lib/ieee754.h"
4cd5b75b 7
16e56d25
VF
8extern void steadystate_check(void);
9extern void steadystate_setup(void);
56a90eba 10extern int td_steadystate_init(struct thread_data *);
bb49c8bd
VF
11extern unsigned long long steadystate_bw_mean(struct thread_stat *);
12extern unsigned long long steadystate_iops_mean(struct thread_stat *);
4cd5b75b 13
84784e07 14extern bool steadystate_enabled;
0a70e050 15
0a70e050
JA
16struct steadystate_data {
17 double limit;
18 unsigned long long dur;
19 unsigned long long ramp_time;
0a70e050 20
bb49c8bd 21 uint32_t state;
0a70e050
JA
22
23 unsigned int head;
24 unsigned int tail;
bb49c8bd
VF
25 uint64_t *iops_data;
26 uint64_t *bw_data;
0a70e050
JA
27
28 double slope;
0a70e050 29 double deviation;
bb49c8bd 30 double criterion;
0a70e050
JA
31
32 unsigned long long sum_y;
33 unsigned long long sum_x;
34 unsigned long long sum_x_sq;
35 unsigned long long sum_xy;
36 unsigned long long oldest_y;
37
38 struct timeval prev_time;
39 unsigned long long prev_iops;
40 unsigned long long prev_bytes;
41};
42
4cd5b75b 43enum {
ad743db4
JA
44 __FIO_SS_IOPS = 1,
45 __FIO_SS_BW = 2,
46 __FIO_SS_SLOPE = 4,
47 __FIO_SS_ATTAINED = 8,
5b4b6586 48 __FIO_SS_RAMP_OVER = 16,
ec55e631 49 __FIO_SS_DATA = 32,
e6a6a984 50 __FIO_SS_PCT = 64,
f0c50c66
JA
51
52 FIO_SS_IOPS = __FIO_SS_IOPS,
53 FIO_SS_IOPS_SLOPE = __FIO_SS_IOPS | __FIO_SS_SLOPE,
54 FIO_SS_BW = __FIO_SS_BW,
55 FIO_SS_BW_SLOPE = __FIO_SS_BW | __FIO_SS_SLOPE,
4cd5b75b
JA
56};
57
84784e07
JA
58#define STEADYSTATE_MSEC 1000
59
16e56d25 60#endif