@cryptotaxi247 / netdata-1 / commits / 8f0a5e3bb

Add new charts for extended disk metrics (#10939)

Vladimir Kobal committed Apr 14, 2021 at 12:19 UTC 8f0a5e3bb25788c136f010ea5424af3cbe585eb6
4 files changed +305 -16
collectors/all.h
+10 -10
@@ -103,16 +103,16 @@
103 // Disks
104
105 #define NETDATA_CHART_PRIO_DISK_IO 2000
106 -#define NETDATA_CHART_PRIO_DISK_OPS 2001
107 -#define NETDATA_CHART_PRIO_DISK_QOPS 2002
108 -#define NETDATA_CHART_PRIO_DISK_BACKLOG 2003
109 -#define NETDATA_CHART_PRIO_DISK_BUSY 2004
110 -#define NETDATA_CHART_PRIO_DISK_UTIL 2005
111 -#define NETDATA_CHART_PRIO_DISK_AWAIT 2006
112 -#define NETDATA_CHART_PRIO_DISK_AVGSZ 2007
113 -#define NETDATA_CHART_PRIO_DISK_SVCTM 2008
114 -#define NETDATA_CHART_PRIO_DISK_MOPS 2021
115 -#define NETDATA_CHART_PRIO_DISK_IOTIME 2022
106 +#define NETDATA_CHART_PRIO_DISK_OPS 2010
107 +#define NETDATA_CHART_PRIO_DISK_QOPS 2015
108 +#define NETDATA_CHART_PRIO_DISK_BACKLOG 2020
109 +#define NETDATA_CHART_PRIO_DISK_BUSY 2030
110 +#define NETDATA_CHART_PRIO_DISK_UTIL 2040
111 +#define NETDATA_CHART_PRIO_DISK_AWAIT 2050
112 +#define NETDATA_CHART_PRIO_DISK_AVGSZ 2060
113 +#define NETDATA_CHART_PRIO_DISK_SVCTM 2070
114 +#define NETDATA_CHART_PRIO_DISK_MOPS 2080
115 +#define NETDATA_CHART_PRIO_DISK_IOTIME 2090
116 #define NETDATA_CHART_PRIO_BCACHE_CACHE_ALLOC 2120
117 #define NETDATA_CHART_PRIO_BCACHE_HIT_RATIO 2120
118 #define NETDATA_CHART_PRIO_BCACHE_RATES 2121
collectors/proc.plugin/README.md
+12
@@ -46,8 +46,11 @@ Hopefully, the Linux kernel provides many metrics that can provide deep insights
46
47 - **I/O bandwidth/s (kb/s)**
48 The amount of data transferred from and to the disk.
49 +- **Amount of discarded data (kb/s)**
50 - **I/O operations/s**
51 The number of I/O operations completed.
52 +- **Extended I/O operations/s**
53 + The number of extended I/O operations completed.
54 - **Queued I/O operations**
55 The number of currently queued I/O operations. For traditional disks that execute commands one after another, one of them is being run by the disk and the rest are just waiting in a queue.
56 - **Backlog size (time in ms)**
@@ -57,12 +60,19 @@ Hopefully, the Linux kernel provides many metrics that can provide deep insights
60 Of course, for newer disk technologies (like fusion cards) that are capable to execute multiple commands in parallel, this metric is just meaningless.
61 - **Average I/O operation time (ms)**
62 The average time for I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
63 +- **Average I/O operation time for extended operations (ms)**
64 + The average time for extended I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
65 - **Average I/O operation size (kb)**
66 The average amount of data of the completed I/O operations.
67 +- **Average amount of discarded data (kb)**
68 + The average amount of data of the completed discard operations.
69 - **Average Service Time (ms)**
70 The average service time for completed I/O operations. This metric is calculated using the total busy time of the disk and the number of completed operations. If the disk is able to execute multiple parallel operations the reporting average service time will be misleading.
71 +- **Average Service Time for extended I/O operations (ms)**
72 + The average service time for completed extended I/O operations.
73 - **Merged I/O operations/s**
74 The Linux kernel is capable of merging I/O operations. So, if two requests to read data from the disk are adjacent, the Linux kernel may merge them to one before giving them to disk. This metric measures the number of operations that have been merged by the Linux kernel.
75 +- **Merged discard operations/s**
76 - **Total I/O time**
77 The sum of the duration of all completed I/O operations. This number can exceed the interval if the disk is able to execute multiple I/O operations in parallel.
78 - **Space usage**
@@ -116,6 +126,7 @@ Then edit `netdata.conf` and find the following section. This is the basic plugi
126 # i/o time for all disks = auto
127 # queued operations for all disks = auto
128 # utilization percentage for all disks = auto
129 + # extended operations for all disks = auto
130 # backlog for all disks = auto
131 # bcache for all disks = auto
132 # bcache priority stats update every = 0
@@ -147,6 +158,7 @@ For each virtual disk, physical disk and partition you will have a section like
158 # i/o time = auto
159 # queued operations = auto
160 # utilization percentage = auto
161 + # extended operations = auto
162 # backlog = auto
163 ```
164
collectors/proc.plugin/proc_diskstats.c
+270 -6
@@ -32,6 +32,7 @@ static struct disk {
32 int do_iotime;
33 int do_qops;
34 int do_util;
35 + int do_ext;
36 int do_backlog;
37 int do_bcache;
38
@@ -64,10 +65,17 @@ static struct disk {
65 RRDDIM *rd_io_reads;
66 RRDDIM *rd_io_writes;
67
68 + RRDSET *st_ext_io;
69 + RRDDIM *rd_io_discards;
70 +
71 RRDSET *st_ops;
72 RRDDIM *rd_ops_reads;
73 RRDDIM *rd_ops_writes;
74
75 + RRDSET *st_ext_ops;
76 + RRDDIM *rd_ops_discards;
77 + RRDDIM *rd_ops_flushes;
78 +
79 RRDSET *st_qops;
80 RRDDIM *rd_qops_operations;
81
@@ -84,18 +92,32 @@ static struct disk {
92 RRDDIM *rd_mops_reads;
93 RRDDIM *rd_mops_writes;
94
95 + RRDSET *st_ext_mops;
96 + RRDDIM *rd_mops_discards;
97 +
98 RRDSET *st_iotime;
99 RRDDIM *rd_iotime_reads;
100 RRDDIM *rd_iotime_writes;
101
102 + RRDSET *st_ext_iotime;
103 + RRDDIM *rd_iotime_discards;
104 + RRDDIM *rd_iotime_flushes;
105 +
106 RRDSET *st_await;
107 RRDDIM *rd_await_reads;
108 RRDDIM *rd_await_writes;
109
110 + RRDSET *st_ext_await;
111 + RRDDIM *rd_await_discards;
112 + RRDDIM *rd_await_flushes;
113 +
114 RRDSET *st_avgsz;
115 RRDDIM *rd_avgsz_reads;
116 RRDDIM *rd_avgsz_writes;
117
118 + RRDSET *st_ext_avgsz;
119 + RRDDIM *rd_avgsz_discards;
120 +
121 RRDSET *st_svctm;
122 RRDDIM *rd_svctm_svctm;
123
@@ -164,6 +186,7 @@ static int global_enable_new_disks_detected_at_runtime = CONFIG_BOOLEAN_YES,
186 global_do_iotime = CONFIG_BOOLEAN_AUTO,
187 global_do_qops = CONFIG_BOOLEAN_AUTO,
188 global_do_util = CONFIG_BOOLEAN_AUTO,
189 + global_do_ext = CONFIG_BOOLEAN_AUTO,
190 global_do_backlog = CONFIG_BOOLEAN_AUTO,
191 global_do_bcache = CONFIG_BOOLEAN_AUTO,
192 globals_initialized = 0,
@@ -463,6 +486,7 @@ static void get_disk_config(struct disk *d) {
486 d->do_iotime = CONFIG_BOOLEAN_NO;
487 d->do_qops = CONFIG_BOOLEAN_NO;
488 d->do_util = CONFIG_BOOLEAN_NO;
489 + d->do_ext = CONFIG_BOOLEAN_NO;
490 d->do_backlog = CONFIG_BOOLEAN_NO;
491 d->do_bcache = CONFIG_BOOLEAN_NO;
492 }
@@ -513,6 +537,7 @@ static void get_disk_config(struct disk *d) {
537 ddo_iotime = CONFIG_BOOLEAN_NO,
538 ddo_qops = CONFIG_BOOLEAN_NO,
539 ddo_util = CONFIG_BOOLEAN_NO,
540 + ddo_ext = CONFIG_BOOLEAN_NO,
541 ddo_backlog = CONFIG_BOOLEAN_NO,
542 ddo_bcache = CONFIG_BOOLEAN_NO;
543
@@ -524,6 +549,7 @@ static void get_disk_config(struct disk *d) {
549 ddo_iotime = global_do_iotime,
550 ddo_qops = global_do_qops,
551 ddo_util = global_do_util,
552 + ddo_ext = global_do_ext,
553 ddo_backlog = global_do_backlog,
554 ddo_bcache = global_do_bcache;
555 }
@@ -534,6 +560,7 @@ static void get_disk_config(struct disk *d) {
560 d->do_iotime = config_get_boolean_ondemand(var_name, "i/o time", ddo_iotime);
561 d->do_qops = config_get_boolean_ondemand(var_name, "queued operations", ddo_qops);
562 d->do_util = config_get_boolean_ondemand(var_name, "utilization percentage", ddo_util);
563 + d->do_ext = config_get_boolean_ondemand(var_name, "extended operations", ddo_ext);
564 d->do_backlog = config_get_boolean_ondemand(var_name, "backlog", ddo_backlog);
565
566 if(d->device_is_bcache)
@@ -820,6 +847,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
847 global_do_iotime = config_get_boolean_ondemand(CONFIG_SECTION_PLUGIN_PROC_DISKSTATS, "i/o time for all disks", global_do_iotime);
848 global_do_qops = config_get_boolean_ondemand(CONFIG_SECTION_PLUGIN_PROC_DISKSTATS, "queued operations for all disks", global_do_qops);
849 global_do_util = config_get_boolean_ondemand(CONFIG_SECTION_PLUGIN_PROC_DISKSTATS, "utilization percentage for all disks", global_do_util);
850 + global_do_ext = config_get_boolean_ondemand(CONFIG_SECTION_PLUGIN_PROC_DISKSTATS, "extended operations for all disks", global_do_ext);
851 global_do_backlog = config_get_boolean_ondemand(CONFIG_SECTION_PLUGIN_PROC_DISKSTATS, "backlog for all disks", global_do_backlog);
852 global_do_bcache = config_get_boolean_ondemand(CONFIG_SECTION_PLUGIN_PROC_DISKSTATS, "bcache for all disks", global_do_bcache);
853 global_bcache_priority_stats_update_every = (int)config_get_number(CONFIG_SECTION_PLUGIN_PROC_DISKSTATS, "bcache priority stats update every", global_bcache_priority_stats_update_every);
@@ -889,6 +917,8 @@ int do_proc_diskstats(int update_every, usec_t dt) {
917
918 collected_number system_read_kb = 0, system_write_kb = 0;
919
920 + int do_dc_stats = 0, do_fl_stats = 0;
921 +
922 for(l = 0; l < lines ;l++) {
923 // --------------------------------------------------------------------------
924 // Read parameters
@@ -898,11 +928,16 @@ int do_proc_diskstats(int update_every, usec_t dt) {
928
929 collected_number reads = 0, mreads = 0, readsectors = 0, readms = 0,
930 writes = 0, mwrites = 0, writesectors = 0, writems = 0,
901 - queued_ios = 0, busy_ms = 0, backlog_ms = 0;
931 + queued_ios = 0, busy_ms = 0, backlog_ms = 0,
932 + discards = 0, mdiscards = 0, discardsectors = 0, discardms = 0,
933 + flushes = 0, flushms = 0;
934 +
935
936 collected_number last_reads = 0, last_readsectors = 0, last_readms = 0,
937 last_writes = 0, last_writesectors = 0, last_writems = 0,
905 - last_busy_ms = 0;
938 + last_busy_ms = 0,
939 + last_discards = 0, last_discardsectors = 0, last_discardms = 0,
940 + last_flushes = 0, last_flushms = 0;
941
942 size_t words = procfile_linewords(ff, l);
943 if(unlikely(words < 14)) continue;
@@ -951,6 +986,40 @@ int do_proc_diskstats(int update_every, usec_t dt) {
986 // I/O completion time and the backlog that may be accumulating.
987 backlog_ms = str2ull(procfile_lineword(ff, l, 13)); // rq_ticks
988
989 + if (unlikely(words > 13)) {
990 + do_dc_stats = 1;
991 +
992 + // # of discards completed
993 + // This is the total number of discards completed successfully.
994 + discards = str2ull(procfile_lineword(ff, l, 14)); // dc_ios
995 +
996 + // # of discards merged
997 + // See the description of mreads/mwrites
998 + mdiscards = str2ull(procfile_lineword(ff, l, 15)); // dc_merges
999 +
1000 + // # of sectors discarded
1001 + // This is the total number of sectors discarded successfully.
1002 + discardsectors = str2ull(procfile_lineword(ff, l, 16)); // dc_sec
1003 +
1004 + // # of milliseconds spent discarding
1005 + // This is the total number of milliseconds spent by all discards (as
1006 + // measured from __make_request() to end_that_request_last()).
1007 + discardms = str2ull(procfile_lineword(ff, l, 17)); // dc_ticks
1008 + }
1009 +
1010 + if (unlikely(words > 17)) {
1011 + do_fl_stats = 1;
1012 +
1013 + // number of flush I/Os processed
1014 + // These values increment when an flush I/O request completes.
1015 + // Block layer combines flush requests and executes at most one at a time.
1016 + // This counts flush requests executed by disk. Not tracked for partitions.
1017 + flushes = str2ull(procfile_lineword(ff, l, 18)); // fl_ios
1018 +
1019 + // total wait time for flush requests
1020 + flushms = str2ull(procfile_lineword(ff, l, 19)); // fl_ticks
1021 + }
1022 +
1023 // --------------------------------------------------------------------------
1024 // get a disk structure for the disk
1025
@@ -976,7 +1045,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
1045 // Do performance metrics
1046
1047 if(d->do_io == CONFIG_BOOLEAN_YES || (d->do_io == CONFIG_BOOLEAN_AUTO &&
979 - (readsectors || writesectors ||
1048 + (readsectors || writesectors || discardsectors ||
1049 netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1050 d->do_io = CONFIG_BOOLEAN_YES;
1051
@@ -1008,8 +1077,37 @@ int do_proc_diskstats(int update_every, usec_t dt) {
1077
1078 // --------------------------------------------------------------------
1079
1080 + if (do_dc_stats && d->do_io == CONFIG_BOOLEAN_YES && d->do_ext != CONFIG_BOOLEAN_NO) {
1081 + if (unlikely(!d->st_ext_io)) {
1082 + d->st_ext_io = rrdset_create_localhost(
1083 + "disk_ext"
1084 + , d->device
1085 + , d->disk
1086 + , family
1087 + , "disk_ext.io"
1088 + , "Amount of Discarded Data"
1089 + , "KiB/s"
1090 + , PLUGIN_PROC_NAME
1091 + , PLUGIN_PROC_MODULE_DISKSTATS_NAME
1092 + , NETDATA_CHART_PRIO_DISK_IO + 1
1093 + , update_every
1094 + , RRDSET_TYPE_AREA
1095 + );
1096 +
1097 + d->rd_io_discards =
1098 + rrddim_add(d->st_ext_io, "discards", NULL, d->sector_size, 1024, RRD_ALGORITHM_INCREMENTAL);
1099 + } else
1100 + rrdset_next(d->st_ext_io);
1101 +
1102 + last_discardsectors = rrddim_set_by_pointer(d->st_ext_io, d->rd_io_discards, discardsectors);
1103 + rrdset_done(d->st_ext_io);
1104 + }
1105 +
1106 + // --------------------------------------------------------------------
1107 +
1108 if(d->do_ops == CONFIG_BOOLEAN_YES || (d->do_ops == CONFIG_BOOLEAN_AUTO &&
1012 - (reads || writes || netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1109 + (reads || writes || discards || flushes ||
1110 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1111 d->do_ops = CONFIG_BOOLEAN_YES;
1112
1113 if(unlikely(!d->st_ops)) {
@@ -1042,6 +1140,39 @@ int do_proc_diskstats(int update_every, usec_t dt) {
1140
1141 // --------------------------------------------------------------------
1142
1143 + if (do_dc_stats && d->do_ops == CONFIG_BOOLEAN_YES && d->do_ext != CONFIG_BOOLEAN_NO) {
1144 + if (unlikely(!d->st_ext_ops)) {
1145 + d->st_ext_ops = rrdset_create_localhost(
1146 + "disk_ext_ops"
1147 + , d->device
1148 + , d->disk
1149 + , family
1150 + , "disk_ext.ops"
1151 + , "Disk Completed Extended I/O Operations"
1152 + , "operations/s"
1153 + , PLUGIN_PROC_NAME
1154 + , PLUGIN_PROC_MODULE_DISKSTATS_NAME
1155 + , NETDATA_CHART_PRIO_DISK_OPS + 1
1156 + , update_every
1157 + , RRDSET_TYPE_LINE
1158 + );
1159 +
1160 + rrdset_flag_set(d->st_ext_ops, RRDSET_FLAG_DETAIL);
1161 +
1162 + d->rd_ops_discards = rrddim_add(d->st_ext_ops, "discards", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1163 + if (do_fl_stats)
1164 + d->rd_ops_flushes = rrddim_add(d->st_ext_ops, "flushes", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1165 + } else
1166 + rrdset_next(d->st_ext_ops);
1167 +
1168 + last_discards = rrddim_set_by_pointer(d->st_ext_ops, d->rd_ops_discards, discards);
1169 + if (do_fl_stats)
1170 + last_flushes = rrddim_set_by_pointer(d->st_ext_ops, d->rd_ops_flushes, flushes);
1171 + rrdset_done(d->st_ext_ops);
1172 + }
1173 +
1174 + // --------------------------------------------------------------------
1175 +
1176 if(d->do_qops == CONFIG_BOOLEAN_YES || (d->do_qops == CONFIG_BOOLEAN_AUTO &&
1177 (queued_ios || netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1178 d->do_qops = CONFIG_BOOLEAN_YES;
@@ -1171,7 +1302,8 @@ int do_proc_diskstats(int update_every, usec_t dt) {
1302 // --------------------------------------------------------------------
1303
1304 if(d->do_mops == CONFIG_BOOLEAN_YES || (d->do_mops == CONFIG_BOOLEAN_AUTO &&
1174 - (mreads || mwrites || netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1305 + (mreads || mwrites || mdiscards ||
1306 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1307 d->do_mops = CONFIG_BOOLEAN_YES;
1308
1309 if(unlikely(!d->st_mops)) {
@@ -1204,8 +1336,39 @@ int do_proc_diskstats(int update_every, usec_t dt) {
1336
1337 // --------------------------------------------------------------------
1338
1339 + if(do_dc_stats && d->do_mops == CONFIG_BOOLEAN_YES && d->do_ext != CONFIG_BOOLEAN_NO) {
1340 + d->do_mops = CONFIG_BOOLEAN_YES;
1341 +
1342 + if(unlikely(!d->st_ext_mops)) {
1343 + d->st_ext_mops = rrdset_create_localhost(
1344 + "disk_ext_mops"
1345 + , d->device
1346 + , d->disk
1347 + , family
1348 + , "disk_ext.mops"
1349 + , "Disk Merged Discard Operations"
1350 + , "merged operations/s"
1351 + , PLUGIN_PROC_NAME
1352 + , PLUGIN_PROC_MODULE_DISKSTATS_NAME
1353 + , NETDATA_CHART_PRIO_DISK_MOPS + 1
1354 + , update_every
1355 + , RRDSET_TYPE_LINE
1356 + );
1357 +
1358 + rrdset_flag_set(d->st_ext_mops, RRDSET_FLAG_DETAIL);
1359 +
1360 + d->rd_mops_discards = rrddim_add(d->st_ext_mops, "discards", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1361 + } else
1362 + rrdset_next(d->st_ext_mops);
1363 +
1364 + rrddim_set_by_pointer(d->st_ext_mops, d->rd_mops_discards, mdiscards);
1365 + rrdset_done(d->st_ext_mops);
1366 + }
1367 +
1368 + // --------------------------------------------------------------------
1369 +
1370 if(d->do_iotime == CONFIG_BOOLEAN_YES || (d->do_iotime == CONFIG_BOOLEAN_AUTO &&
1208 - (readms || writems || netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1371 + (readms || writems || discardms || flushms || netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1372 d->do_iotime = CONFIG_BOOLEAN_YES;
1373
1374 if(unlikely(!d->st_iotime)) {
@@ -1236,6 +1399,40 @@ int do_proc_diskstats(int update_every, usec_t dt) {
1399 rrdset_done(d->st_iotime);
1400 }
1401
1402 + // --------------------------------------------------------------------
1403 +
1404 + if(do_dc_stats && d->do_iotime == CONFIG_BOOLEAN_YES && d->do_ext != CONFIG_BOOLEAN_NO) {
1405 + if(unlikely(!d->st_ext_iotime)) {
1406 + d->st_ext_iotime = rrdset_create_localhost(
1407 + "disk_ext_iotime"
1408 + , d->device
1409 + , d->disk
1410 + , family
1411 + , "disk_ext.iotime"
1412 + , "Disk Total I/O Time for Extended Operations"
1413 + , "milliseconds/s"
1414 + , PLUGIN_PROC_NAME
1415 + , PLUGIN_PROC_MODULE_DISKSTATS_NAME
1416 + , NETDATA_CHART_PRIO_DISK_IOTIME + 1
1417 + , update_every
1418 + , RRDSET_TYPE_LINE
1419 + );
1420 +
1421 + rrdset_flag_set(d->st_ext_iotime, RRDSET_FLAG_DETAIL);
1422 +
1423 + d->rd_iotime_discards = rrddim_add(d->st_ext_iotime, "discards", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1424 + if (do_fl_stats)
1425 + d->rd_iotime_flushes =
1426 + rrddim_add(d->st_ext_iotime, "flushes", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1427 + } else
1428 + rrdset_next(d->st_ext_iotime);
1429 +
1430 + last_discardms = rrddim_set_by_pointer(d->st_ext_iotime, d->rd_iotime_discards, discardms);
1431 + if (do_fl_stats)
1432 + last_flushms = rrddim_set_by_pointer(d->st_ext_iotime, d->rd_iotime_flushes, flushms);
1433 + rrdset_done(d->st_ext_iotime);
1434 + }
1435 +
1436 // --------------------------------------------------------------------
1437 // calculate differential charts
1438 // only if this is not the first time we run
@@ -1276,6 +1473,42 @@ int do_proc_diskstats(int update_every, usec_t dt) {
1473 rrdset_done(d->st_await);
1474 }
1475
1476 + if (do_dc_stats && d->do_iotime == CONFIG_BOOLEAN_YES && d->do_ops == CONFIG_BOOLEAN_YES && d->do_ext != CONFIG_BOOLEAN_NO) {
1477 + if(unlikely(!d->st_ext_await)) {
1478 + d->st_ext_await = rrdset_create_localhost(
1479 + "disk_ext_await"
1480 + , d->device
1481 + , d->disk
1482 + , family
1483 + , "disk_ext.await"
1484 + , "Average Completed Extended I/O Operation Time"
1485 + , "milliseconds/operation"
1486 + , PLUGIN_PROC_NAME
1487 + , PLUGIN_PROC_MODULE_DISKSTATS_NAME
1488 + , NETDATA_CHART_PRIO_DISK_AWAIT + 1
1489 + , update_every
1490 + , RRDSET_TYPE_LINE
1491 + );
1492 +
1493 + rrdset_flag_set(d->st_ext_await, RRDSET_FLAG_DETAIL);
1494 +
1495 + d->rd_await_discards = rrddim_add(d->st_ext_await, "discards", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
1496 + if (do_fl_stats)
1497 + d->rd_await_flushes =
1498 + rrddim_add(d->st_ext_await, "flushes", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
1499 + } else
1500 + rrdset_next(d->st_ext_await);
1501 +
1502 + rrddim_set_by_pointer(
1503 + d->st_ext_await, d->rd_await_discards,
1504 + (discards - last_discards) ? (discardms - last_discardms) / (discards - last_discards) : 0);
1505 + if (do_fl_stats)
1506 + rrddim_set_by_pointer(
1507 + d->st_ext_await, d->rd_await_flushes,
1508 + (flushes - last_flushes) ? (flushms - last_flushms) / (flushes - last_flushes) : 0);
1509 + rrdset_done(d->st_ext_await);
1510 + }
1511 +
1512 if( (d->do_io == CONFIG_BOOLEAN_YES || (d->do_io == CONFIG_BOOLEAN_AUTO &&
1513 (readsectors || writesectors || netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) &&
1514 (d->do_ops == CONFIG_BOOLEAN_YES || (d->do_ops == CONFIG_BOOLEAN_AUTO &&
@@ -1309,6 +1542,37 @@ int do_proc_diskstats(int update_every, usec_t dt) {
1542 rrdset_done(d->st_avgsz);
1543 }
1544
1545 + if(do_dc_stats && d->do_io == CONFIG_BOOLEAN_YES && d->do_ops == CONFIG_BOOLEAN_YES && d->do_ext != CONFIG_BOOLEAN_NO) {
1546 + if(unlikely(!d->st_ext_avgsz)) {
1547 + d->st_ext_avgsz = rrdset_create_localhost(
1548 + "disk_ext_avgsz"
1549 + , d->device
1550 + , d->disk
1551 + , family
1552 + , "disk_ext.avgsz"
1553 + , "Average Amount of Discarded Data"
1554 + , "KiB/operation"
1555 + , PLUGIN_PROC_NAME
1556 + , PLUGIN_PROC_MODULE_DISKSTATS_NAME
1557 + , NETDATA_CHART_PRIO_DISK_AVGSZ
1558 + , update_every
1559 + , RRDSET_TYPE_AREA
1560 + );
1561 +
1562 + rrdset_flag_set(d->st_ext_avgsz, RRDSET_FLAG_DETAIL);
1563 +
1564 + d->rd_avgsz_discards =
1565 + rrddim_add(d->st_ext_avgsz, "discards", NULL, d->sector_size, 1024, RRD_ALGORITHM_ABSOLUTE);
1566 + } else
1567 + rrdset_next(d->st_ext_avgsz);
1568 +
1569 + rrddim_set_by_pointer(
1570 + d->st_ext_avgsz, d->rd_avgsz_discards,
1571 + (discards - last_discards) ? (discardsectors - last_discardsectors) / (discards - last_discards) :
1572 + 0);
1573 + rrdset_done(d->st_ext_avgsz);
1574 + }
1575 +
1576 if( (d->do_util == CONFIG_BOOLEAN_YES || (d->do_util == CONFIG_BOOLEAN_AUTO &&
1577 (busy_ms ||
1578 netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) &&
web/gui/dashboard_info.js
+13
@@ -1424,10 +1424,16 @@ netdataDashboard.context = {
1424 height: 0.5,
1425 info: 'The sum of the duration of all completed I/O operations. This number can exceed the interval if the disk is able to execute I/O operations in parallel.'
1426 },
1427 + 'disk_ext.iotime': {
1428 + height: 0.5
1429 + },
1430 'disk.mops': {
1431 height: 0.5,
1432 info: 'The number of merged disk operations. The system is able to merge adjacent I/O operations, for example two 4KB reads can become one 8KB read before given to disk.'
1433 },
1434 + 'disk_ext.mops': {
1435 + height: 0.5
1436 + },
1437 'disk.svctm': {
1438 height: 0.5,
1439 info: 'The average service time for completed I/O operations. This metric is calculated using the total busy time of the disk and the number of completed operations. If the disk is able to execute multiple parallel operations the reporting average service time will be misleading.'
@@ -1436,10 +1442,17 @@ netdataDashboard.context = {
1442 height: 0.5,
1443 info: 'The average I/O operation size.'
1444 },
1445 + 'disk_ext.avgsz': {
1446 + height: 0.5
1447 + },
1448 'disk.await': {
1449 height: 0.5,
1450 info: 'The average time for I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.'
1451 },
1452 + 'disk_ext.await': {
1453 + height: 0.5,
1454 + info: 'The average time for extended I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.'
1455 + },
1456
1457 'disk.space': {
1458 info: 'Disk space utilization. reserved for root is automatically reserved by the system to prevent the root user from getting out of space.'