Skip to content

Commit

Permalink
stat: Increase depth levels to log latency
Browse files Browse the repository at this point in the history
Previously latency log depth levels are 10 for nsec and usec and 12 for msec.
But to measure latency variation on a finer granularity required to increase.
So increase the depth levels as 20 for nsec and usec and 22 for msec.

Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t committed Apr 11, 2021
1 parent 1588c8f commit 23e94ba
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 48 deletions.
8 changes: 6 additions & 2 deletions HOWTO
Original file line number Diff line number Diff line change
Expand Up @@ -4017,13 +4017,17 @@ field was introduced or whether it's specific to some terse version):

<=1, 2, 4, 8, 16, 32, >=64

I/O latencies nanoseconds::

<=2, 3, 4, 6, 8, 10, 15, 20, 35, 50, 75, 100, 175, 250, 375, 500, 625, 750, 875, 1000

I/O latencies microseconds::

<=2, 4, 10, 20, 50, 100, 250, 500, 750, 1000
<=2, 3, 4, 6, 8, 10, 15, 20, 35, 50, 75, 100, 175, 250, 375, 500, 625, 750, 875, 1000

I/O latencies milliseconds::

<=2, 4, 10, 20, 50, 100, 250, 500, 750, 1000, 2000, >=2000
<=2, 3, 4, 6, 8, 10, 15, 20, 35, 50, 75, 100, 175, 250, 375, 500, 625, 750, 875, 1000, 2000, >=2000

Disk utilization [v3]::

Expand Down
13 changes: 11 additions & 2 deletions fio.1
Original file line number Diff line number Diff line change
Expand Up @@ -3710,11 +3710,20 @@ I/O depths:
.RS
.P
.B
I/O latencies nanoseconds:
.RE
.P
.nf
<=2, 3, 4, 6, 8, 10, 15, 20, 35, 50, 75, 100, 175, 250, 375, 500, 625, 750, 875, 1000
.fi
.RS
.P
.B
I/O latencies microseconds:
.RE
.P
.nf
<=2, 4, 10, 20, 50, 100, 250, 500, 750, 1000
<=2, 3, 4, 6, 8, 10, 15, 20, 35, 50, 75, 100, 175, 250, 375, 500, 625, 750, 875, 1000
.fi
.RS
.P
Expand All @@ -3723,7 +3732,7 @@ I/O latencies milliseconds:
.RE
.P
.nf
<=2, 4, 10, 20, 50, 100, 250, 500, 750, 1000, 2000, >=2000
<=2, 3, 4, 6, 8, 10, 15, 20, 35, 50, 75, 100, 175, 250, 375, 500, 625, 750, 875, 1000, 2000, >=2000
.fi
.RS
.P
Expand Down
146 changes: 118 additions & 28 deletions io_u.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,31 +1050,61 @@ static void io_u_mark_lat_nsec(struct thread_data *td, unsigned long long nsec)
assert(nsec < 1000);

switch (nsec) {
case 750 ... 999:
case 875 ... 999:
idx = 19;
break;
case 750 ... 874:
idx = 18;
break;
case 625 ... 749:
idx = 17;
break;
case 500 ... 624:
idx = 16;
break;
case 375 ... 499:
idx = 15;
break;
case 250 ... 374:
idx = 14;
break;
case 175 ... 249:
idx = 13;
break;
case 100 ... 174:
idx = 12;
break;
case 75 ... 99:
idx = 11;
break;
case 50 ... 74:
idx = 10;
break;
case 35 ... 49:
idx = 9;
break;
case 500 ... 749:
case 20 ... 34:
idx = 8;
break;
case 250 ... 499:
case 15 ... 19:
idx = 7;
break;
case 100 ... 249:
case 10 ... 14:
idx = 6;
break;
case 50 ... 99:
case 8 ... 9:
idx = 5;
break;
case 20 ... 49:
case 6 ... 7:
idx = 4;
break;
case 10 ... 19:
case 4 ... 5:
idx = 3;
break;
case 4 ... 9:
case 3:
idx = 2;
break;
case 2 ... 3:
case 2:
idx = 1;
fallthrough;
case 0 ... 1:
Expand All @@ -1092,31 +1122,61 @@ static void io_u_mark_lat_usec(struct thread_data *td, unsigned long long usec)
assert(usec < 1000 && usec >= 1);

switch (usec) {
case 750 ... 999:
case 875 ... 999:
idx = 19;
break;
case 750 ... 874:
idx = 18;
break;
case 625 ... 749:
idx = 17;
break;
case 500 ... 624:
idx = 16;
break;
case 375 ... 499:
idx = 15;
break;
case 250 ... 374:
idx = 14;
break;
case 175 ... 249:
idx = 13;
break;
case 100 ... 174:
idx = 12;
break;
case 75 ... 99:
idx = 11;
break;
case 50 ... 74:
idx = 10;
break;
case 35 ... 49:
idx = 9;
break;
case 500 ... 749:
case 20 ... 34:
idx = 8;
break;
case 250 ... 499:
case 15 ... 19:
idx = 7;
break;
case 100 ... 249:
case 10 ... 14:
idx = 6;
break;
case 50 ... 99:
case 8 ... 9:
idx = 5;
break;
case 20 ... 49:
case 6 ... 7:
idx = 4;
break;
case 10 ... 19:
case 4 ... 5:
idx = 3;
break;
case 4 ... 9:
case 3:
idx = 2;
break;
case 2 ... 3:
case 2:
idx = 1;
fallthrough;
case 0 ... 1:
Expand All @@ -1135,36 +1195,66 @@ static void io_u_mark_lat_msec(struct thread_data *td, unsigned long long msec)

switch (msec) {
default:
idx = 11;
idx = 21;
break;
case 1000 ... 1999:
idx = 20;
break;
case 875 ... 999:
idx = 19;
break;
case 750 ... 874:
idx = 18;
break;
case 625 ... 749:
idx = 17;
break;
case 500 ... 624:
idx = 16;
break;
case 375 ... 499:
idx = 15;
break;
case 250 ... 374:
idx = 14;
break;
case 175 ... 249:
idx = 13;
break;
case 100 ... 174:
idx = 12;
break;
case 75 ... 99:
idx = 11;
break;
case 50 ... 74:
idx = 10;
break;
case 750 ... 999:
case 35 ... 49:
idx = 9;
break;
case 500 ... 749:
case 20 ... 34:
idx = 8;
break;
case 250 ... 499:
case 15 ... 19:
idx = 7;
break;
case 100 ... 249:
case 10 ... 14:
idx = 6;
break;
case 50 ... 99:
case 8 ... 9:
idx = 5;
break;
case 20 ... 49:
case 6 ... 7:
idx = 4;
break;
case 10 ... 19:
case 4 ... 5:
idx = 3;
break;
case 4 ... 9:
case 3:
idx = 2;
break;
case 2 ... 3:
case 2:
idx = 1;
fallthrough;
case 0 ... 1:
Expand Down
2 changes: 1 addition & 1 deletion server.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct fio_net_cmd_reply {
};

enum {
FIO_SERVER_VER = 89,
FIO_SERVER_VER = 90,

FIO_SERVER_MAX_FRAGMENT_PDU = 1024,
FIO_SERVER_MAX_CMD_MB = 2048,
Expand Down
36 changes: 24 additions & 12 deletions stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,24 +831,30 @@ static bool show_lat(double *io_u_lat, int nr, const char **ranges,

static void show_lat_n(double *io_u_lat_n, struct buf_output *out)
{
const char *ranges[] = { "2=", "4=", "10=", "20=", "50=", "100=",
"250=", "500=", "750=", "1000=", };
const char *ranges[] = { "2=", "3=", "4=", "6=", "8=", "10=",
"15=", "20=", "35=", "50=", "75=", "100=",
"175=", "250=", "375=", "500=",
"625=", "750=", "875=", "1000=", };

show_lat(io_u_lat_n, FIO_IO_U_LAT_N_NR, ranges, "nsec", out);
}

static void show_lat_u(double *io_u_lat_u, struct buf_output *out)
{
const char *ranges[] = { "2=", "4=", "10=", "20=", "50=", "100=",
"250=", "500=", "750=", "1000=", };
const char *ranges[] = { "2=", "3=", "4=", "6=", "8=", "10=",
"15=", "20=", "35=", "50=", "75=", "100=",
"175=", "250=", "375=", "500=",
"625=", "750=", "875=", "1000=", };

show_lat(io_u_lat_u, FIO_IO_U_LAT_U_NR, ranges, "usec", out);
}

static void show_lat_m(double *io_u_lat_m, struct buf_output *out)
{
const char *ranges[] = { "2=", "4=", "10=", "20=", "50=", "100=",
"250=", "500=", "750=", "1000=", "2000=",
const char *ranges[] = { "2=", "3=", "4=", "6=", "8=", "10=",
"15=", "20=", "35=", "50=", "75=", "100=",
"175=", "250=", "375=", "500=",
"625=", "750=", "875=", "1000=", "2000=",
">=2000=", };

show_lat(io_u_lat_m, FIO_IO_U_LAT_M_NR, ranges, "msec", out);
Expand Down Expand Up @@ -1902,24 +1908,30 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts,
tmp = json_create_object();
json_object_add_value_object(root, "latency_ns", tmp);
for (i = 0; i < FIO_IO_U_LAT_N_NR; i++) {
const char *ranges[] = { "2", "4", "10", "20", "50", "100",
"250", "500", "750", "1000", };
const char *ranges[] = { "2=", "3=", "4=", "6=", "8=", "10=",
"15=", "20=", "35=", "50=", "75=", "100=",
"175=", "250=", "375=", "500=",
"625=", "750=", "875=", "1000=", };
json_object_add_value_float(tmp, ranges[i], io_u_lat_n[i]);
}
/* Microsecond latency */
tmp = json_create_object();
json_object_add_value_object(root, "latency_us", tmp);
for (i = 0; i < FIO_IO_U_LAT_U_NR; i++) {
const char *ranges[] = { "2", "4", "10", "20", "50", "100",
"250", "500", "750", "1000", };
const char *ranges[] = { "2=", "3=", "4=", "6=", "8=", "10=",
"15=", "20=", "35=", "50=", "75=", "100=",
"175=", "250=", "375=", "500=",
"625=", "750=", "875=", "1000=", };
json_object_add_value_float(tmp, ranges[i], io_u_lat_u[i]);
}
/* Millisecond latency */
tmp = json_create_object();
json_object_add_value_object(root, "latency_ms", tmp);
for (i = 0; i < FIO_IO_U_LAT_M_NR; i++) {
const char *ranges[] = { "2", "4", "10", "20", "50", "100",
"250", "500", "750", "1000", "2000",
const char *ranges[] = { "2=", "3=", "4=", "6=", "8=", "10=",
"15=", "20=", "35=", "50=", "75=", "100=",
"175=", "250=", "375=", "500=",
"625=", "750=", "875=", "1000=", "2000",
">=2000", };
json_object_add_value_float(tmp, ranges[i], io_u_lat_m[i]);
}
Expand Down
6 changes: 3 additions & 3 deletions stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ struct group_run_stats {
* How many depth levels to log
*/
#define FIO_IO_U_MAP_NR 7
#define FIO_IO_U_LAT_N_NR 10
#define FIO_IO_U_LAT_U_NR 10
#define FIO_IO_U_LAT_M_NR 12
#define FIO_IO_U_LAT_N_NR 20
#define FIO_IO_U_LAT_U_NR 20
#define FIO_IO_U_LAT_M_NR 22

/*
* Constants for clat percentiles
Expand Down

0 comments on commit 23e94ba

Please sign in to comment.