Skip to content

Commit 23e94ba

Browse files
committed
stat: Increase depth levels to log latency
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]>
1 parent 1588c8f commit 23e94ba

File tree

6 files changed

+163
-48
lines changed

6 files changed

+163
-48
lines changed

HOWTO

+6-2
Original file line numberDiff line numberDiff line change
@@ -4017,13 +4017,17 @@ field was introduced or whether it's specific to some terse version):
40174017

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

4020+
I/O latencies nanoseconds::
4021+
4022+
<=2, 3, 4, 6, 8, 10, 15, 20, 35, 50, 75, 100, 175, 250, 375, 500, 625, 750, 875, 1000
4023+
40204024
I/O latencies microseconds::
40214025

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

40244028
I/O latencies milliseconds::
40254029

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

40284032
Disk utilization [v3]::
40294033

fio.1

+11-2
Original file line numberDiff line numberDiff line change
@@ -3710,11 +3710,20 @@ I/O depths:
37103710
.RS
37113711
.P
37123712
.B
3713+
I/O latencies nanoseconds:
3714+
.RE
3715+
.P
3716+
.nf
3717+
<=2, 3, 4, 6, 8, 10, 15, 20, 35, 50, 75, 100, 175, 250, 375, 500, 625, 750, 875, 1000
3718+
.fi
3719+
.RS
3720+
.P
3721+
.B
37133722
I/O latencies microseconds:
37143723
.RE
37153724
.P
37163725
.nf
3717-
<=2, 4, 10, 20, 50, 100, 250, 500, 750, 1000
3726+
<=2, 3, 4, 6, 8, 10, 15, 20, 35, 50, 75, 100, 175, 250, 375, 500, 625, 750, 875, 1000
37183727
.fi
37193728
.RS
37203729
.P
@@ -3723,7 +3732,7 @@ I/O latencies milliseconds:
37233732
.RE
37243733
.P
37253734
.nf
3726-
<=2, 4, 10, 20, 50, 100, 250, 500, 750, 1000, 2000, >=2000
3735+
<=2, 3, 4, 6, 8, 10, 15, 20, 35, 50, 75, 100, 175, 250, 375, 500, 625, 750, 875, 1000, 2000, >=2000
37273736
.fi
37283737
.RS
37293738
.P

io_u.c

+118-28
Original file line numberDiff line numberDiff line change
@@ -1050,31 +1050,61 @@ static void io_u_mark_lat_nsec(struct thread_data *td, unsigned long long nsec)
10501050
assert(nsec < 1000);
10511051

10521052
switch (nsec) {
1053-
case 750 ... 999:
1053+
case 875 ... 999:
1054+
idx = 19;
1055+
break;
1056+
case 750 ... 874:
1057+
idx = 18;
1058+
break;
1059+
case 625 ... 749:
1060+
idx = 17;
1061+
break;
1062+
case 500 ... 624:
1063+
idx = 16;
1064+
break;
1065+
case 375 ... 499:
1066+
idx = 15;
1067+
break;
1068+
case 250 ... 374:
1069+
idx = 14;
1070+
break;
1071+
case 175 ... 249:
1072+
idx = 13;
1073+
break;
1074+
case 100 ... 174:
1075+
idx = 12;
1076+
break;
1077+
case 75 ... 99:
1078+
idx = 11;
1079+
break;
1080+
case 50 ... 74:
1081+
idx = 10;
1082+
break;
1083+
case 35 ... 49:
10541084
idx = 9;
10551085
break;
1056-
case 500 ... 749:
1086+
case 20 ... 34:
10571087
idx = 8;
10581088
break;
1059-
case 250 ... 499:
1089+
case 15 ... 19:
10601090
idx = 7;
10611091
break;
1062-
case 100 ... 249:
1092+
case 10 ... 14:
10631093
idx = 6;
10641094
break;
1065-
case 50 ... 99:
1095+
case 8 ... 9:
10661096
idx = 5;
10671097
break;
1068-
case 20 ... 49:
1098+
case 6 ... 7:
10691099
idx = 4;
10701100
break;
1071-
case 10 ... 19:
1101+
case 4 ... 5:
10721102
idx = 3;
10731103
break;
1074-
case 4 ... 9:
1104+
case 3:
10751105
idx = 2;
10761106
break;
1077-
case 2 ... 3:
1107+
case 2:
10781108
idx = 1;
10791109
fallthrough;
10801110
case 0 ... 1:
@@ -1092,31 +1122,61 @@ static void io_u_mark_lat_usec(struct thread_data *td, unsigned long long usec)
10921122
assert(usec < 1000 && usec >= 1);
10931123

10941124
switch (usec) {
1095-
case 750 ... 999:
1125+
case 875 ... 999:
1126+
idx = 19;
1127+
break;
1128+
case 750 ... 874:
1129+
idx = 18;
1130+
break;
1131+
case 625 ... 749:
1132+
idx = 17;
1133+
break;
1134+
case 500 ... 624:
1135+
idx = 16;
1136+
break;
1137+
case 375 ... 499:
1138+
idx = 15;
1139+
break;
1140+
case 250 ... 374:
1141+
idx = 14;
1142+
break;
1143+
case 175 ... 249:
1144+
idx = 13;
1145+
break;
1146+
case 100 ... 174:
1147+
idx = 12;
1148+
break;
1149+
case 75 ... 99:
1150+
idx = 11;
1151+
break;
1152+
case 50 ... 74:
1153+
idx = 10;
1154+
break;
1155+
case 35 ... 49:
10961156
idx = 9;
10971157
break;
1098-
case 500 ... 749:
1158+
case 20 ... 34:
10991159
idx = 8;
11001160
break;
1101-
case 250 ... 499:
1161+
case 15 ... 19:
11021162
idx = 7;
11031163
break;
1104-
case 100 ... 249:
1164+
case 10 ... 14:
11051165
idx = 6;
11061166
break;
1107-
case 50 ... 99:
1167+
case 8 ... 9:
11081168
idx = 5;
11091169
break;
1110-
case 20 ... 49:
1170+
case 6 ... 7:
11111171
idx = 4;
11121172
break;
1113-
case 10 ... 19:
1173+
case 4 ... 5:
11141174
idx = 3;
11151175
break;
1116-
case 4 ... 9:
1176+
case 3:
11171177
idx = 2;
11181178
break;
1119-
case 2 ... 3:
1179+
case 2:
11201180
idx = 1;
11211181
fallthrough;
11221182
case 0 ... 1:
@@ -1135,36 +1195,66 @@ static void io_u_mark_lat_msec(struct thread_data *td, unsigned long long msec)
11351195

11361196
switch (msec) {
11371197
default:
1138-
idx = 11;
1198+
idx = 21;
11391199
break;
11401200
case 1000 ... 1999:
1201+
idx = 20;
1202+
break;
1203+
case 875 ... 999:
1204+
idx = 19;
1205+
break;
1206+
case 750 ... 874:
1207+
idx = 18;
1208+
break;
1209+
case 625 ... 749:
1210+
idx = 17;
1211+
break;
1212+
case 500 ... 624:
1213+
idx = 16;
1214+
break;
1215+
case 375 ... 499:
1216+
idx = 15;
1217+
break;
1218+
case 250 ... 374:
1219+
idx = 14;
1220+
break;
1221+
case 175 ... 249:
1222+
idx = 13;
1223+
break;
1224+
case 100 ... 174:
1225+
idx = 12;
1226+
break;
1227+
case 75 ... 99:
1228+
idx = 11;
1229+
break;
1230+
case 50 ... 74:
11411231
idx = 10;
11421232
break;
1143-
case 750 ... 999:
1233+
case 35 ... 49:
11441234
idx = 9;
11451235
break;
1146-
case 500 ... 749:
1236+
case 20 ... 34:
11471237
idx = 8;
11481238
break;
1149-
case 250 ... 499:
1239+
case 15 ... 19:
11501240
idx = 7;
11511241
break;
1152-
case 100 ... 249:
1242+
case 10 ... 14:
11531243
idx = 6;
11541244
break;
1155-
case 50 ... 99:
1245+
case 8 ... 9:
11561246
idx = 5;
11571247
break;
1158-
case 20 ... 49:
1248+
case 6 ... 7:
11591249
idx = 4;
11601250
break;
1161-
case 10 ... 19:
1251+
case 4 ... 5:
11621252
idx = 3;
11631253
break;
1164-
case 4 ... 9:
1254+
case 3:
11651255
idx = 2;
11661256
break;
1167-
case 2 ... 3:
1257+
case 2:
11681258
idx = 1;
11691259
fallthrough;
11701260
case 0 ... 1:

server.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct fio_net_cmd_reply {
4848
};
4949

5050
enum {
51-
FIO_SERVER_VER = 89,
51+
FIO_SERVER_VER = 90,
5252

5353
FIO_SERVER_MAX_FRAGMENT_PDU = 1024,
5454
FIO_SERVER_MAX_CMD_MB = 2048,

stat.c

+24-12
Original file line numberDiff line numberDiff line change
@@ -831,24 +831,30 @@ static bool show_lat(double *io_u_lat, int nr, const char **ranges,
831831

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

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

840842
static void show_lat_u(double *io_u_lat_u, struct buf_output *out)
841843
{
842-
const char *ranges[] = { "2=", "4=", "10=", "20=", "50=", "100=",
843-
"250=", "500=", "750=", "1000=", };
844+
const char *ranges[] = { "2=", "3=", "4=", "6=", "8=", "10=",
845+
"15=", "20=", "35=", "50=", "75=", "100=",
846+
"175=", "250=", "375=", "500=",
847+
"625=", "750=", "875=", "1000=", };
844848

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

848852
static void show_lat_m(double *io_u_lat_m, struct buf_output *out)
849853
{
850-
const char *ranges[] = { "2=", "4=", "10=", "20=", "50=", "100=",
851-
"250=", "500=", "750=", "1000=", "2000=",
854+
const char *ranges[] = { "2=", "3=", "4=", "6=", "8=", "10=",
855+
"15=", "20=", "35=", "50=", "75=", "100=",
856+
"175=", "250=", "375=", "500=",
857+
"625=", "750=", "875=", "1000=", "2000=",
852858
">=2000=", };
853859

854860
show_lat(io_u_lat_m, FIO_IO_U_LAT_M_NR, ranges, "msec", out);
@@ -1902,24 +1908,30 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts,
19021908
tmp = json_create_object();
19031909
json_object_add_value_object(root, "latency_ns", tmp);
19041910
for (i = 0; i < FIO_IO_U_LAT_N_NR; i++) {
1905-
const char *ranges[] = { "2", "4", "10", "20", "50", "100",
1906-
"250", "500", "750", "1000", };
1911+
const char *ranges[] = { "2=", "3=", "4=", "6=", "8=", "10=",
1912+
"15=", "20=", "35=", "50=", "75=", "100=",
1913+
"175=", "250=", "375=", "500=",
1914+
"625=", "750=", "875=", "1000=", };
19071915
json_object_add_value_float(tmp, ranges[i], io_u_lat_n[i]);
19081916
}
19091917
/* Microsecond latency */
19101918
tmp = json_create_object();
19111919
json_object_add_value_object(root, "latency_us", tmp);
19121920
for (i = 0; i < FIO_IO_U_LAT_U_NR; i++) {
1913-
const char *ranges[] = { "2", "4", "10", "20", "50", "100",
1914-
"250", "500", "750", "1000", };
1921+
const char *ranges[] = { "2=", "3=", "4=", "6=", "8=", "10=",
1922+
"15=", "20=", "35=", "50=", "75=", "100=",
1923+
"175=", "250=", "375=", "500=",
1924+
"625=", "750=", "875=", "1000=", };
19151925
json_object_add_value_float(tmp, ranges[i], io_u_lat_u[i]);
19161926
}
19171927
/* Millisecond latency */
19181928
tmp = json_create_object();
19191929
json_object_add_value_object(root, "latency_ms", tmp);
19201930
for (i = 0; i < FIO_IO_U_LAT_M_NR; i++) {
1921-
const char *ranges[] = { "2", "4", "10", "20", "50", "100",
1922-
"250", "500", "750", "1000", "2000",
1931+
const char *ranges[] = { "2=", "3=", "4=", "6=", "8=", "10=",
1932+
"15=", "20=", "35=", "50=", "75=", "100=",
1933+
"175=", "250=", "375=", "500=",
1934+
"625=", "750=", "875=", "1000=", "2000",
19231935
">=2000", };
19241936
json_object_add_value_float(tmp, ranges[i], io_u_lat_m[i]);
19251937
}

stat.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ struct group_run_stats {
2222
* How many depth levels to log
2323
*/
2424
#define FIO_IO_U_MAP_NR 7
25-
#define FIO_IO_U_LAT_N_NR 10
26-
#define FIO_IO_U_LAT_U_NR 10
27-
#define FIO_IO_U_LAT_M_NR 12
25+
#define FIO_IO_U_LAT_N_NR 20
26+
#define FIO_IO_U_LAT_U_NR 20
27+
#define FIO_IO_U_LAT_M_NR 22
2828

2929
/*
3030
* Constants for clat percentiles

0 commit comments

Comments
 (0)