summaryrefslogtreecommitdiffstats
path: root/collectors/proc.plugin/proc_diskstats.c
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/proc.plugin/proc_diskstats.c')
-rw-r--r--collectors/proc.plugin/proc_diskstats.c162
1 files changed, 64 insertions, 98 deletions
diff --git a/collectors/proc.plugin/proc_diskstats.c b/collectors/proc.plugin/proc_diskstats.c
index be4a481cd..28d0e7584 100644
--- a/collectors/proc.plugin/proc_diskstats.c
+++ b/collectors/proc.plugin/proc_diskstats.c
@@ -25,6 +25,8 @@ static struct disk {
char *mount_point;
+ char *chart_id;
+
// disk options caching
int do_io;
int do_ops;
@@ -283,7 +285,7 @@ void bcache_read_priority_stats(struct disk *d, const char *family, int update_e
if(unlikely(!d->st_bcache_cache_allocations)) {
d->st_bcache_cache_allocations = rrdset_create_localhost(
"disk_bcache_cache_alloc"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.bcache_cache_alloc"
@@ -304,7 +306,6 @@ void bcache_read_priority_stats(struct disk *d, const char *family, int update_e
d->bcache_priority_stats_update_every_usec = update_every * USEC_PER_SEC;
}
- else rrdset_next(d->st_bcache_cache_allocations);
rrddim_set_by_pointer(d->st_bcache_cache_allocations, d->rd_bcache_cache_allocations_unused, unused);
rrddim_set_by_pointer(d->st_bcache_cache_allocations, d->rd_bcache_cache_allocations_dirty, dirty);
@@ -609,6 +610,26 @@ static struct disk *get_disk(unsigned long major, unsigned long minor, char *dis
last->next = d;
}
+ d->chart_id = strdupz(d->device);
+
+ // read device uuid if it is an LVM volume
+ if (!strncmp(d->device, "dm-", 3)) {
+ char uuid_filename[FILENAME_MAX + 1];
+ snprintfz(uuid_filename, FILENAME_MAX, path_to_sys_devices_virtual_block_device, disk);
+ strncat(uuid_filename, "/dm/uuid", FILENAME_MAX);
+
+ char device_uuid[RRD_ID_LENGTH_MAX + 1];
+ if (!read_file(uuid_filename, device_uuid, RRD_ID_LENGTH_MAX) && !strncmp(device_uuid, "LVM-", 4)) {
+ trim(device_uuid);
+
+ char chart_id[RRD_ID_LENGTH_MAX + 1];
+ snprintf(chart_id, RRD_ID_LENGTH_MAX, "%s-%s", d->device, device_uuid + 4);
+
+ freez(d->chart_id);
+ d->chart_id = strdupz(chart_id);
+ }
+ }
+
char buffer[FILENAME_MAX + 1];
// find if it is a physical disk
@@ -831,25 +852,25 @@ static struct disk *get_disk(unsigned long major, unsigned long minor, char *dis
}
static void add_labels_to_disk(struct disk *d, RRDSET *st) {
- rrdlabels_add(st->state->chart_labels, "device", d->disk, RRDLABEL_SRC_AUTO);
- rrdlabels_add(st->state->chart_labels, "mount_point", d->mount_point, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device", d->disk, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "mount_point", d->mount_point, RRDLABEL_SRC_AUTO);
switch (d->type) {
default:
case DISK_TYPE_UNKNOWN:
- rrdlabels_add(st->state->chart_labels, "device_type", "unknown", RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device_type", "unknown", RRDLABEL_SRC_AUTO);
break;
case DISK_TYPE_PHYSICAL:
- rrdlabels_add(st->state->chart_labels, "device_type", "physical", RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device_type", "physical", RRDLABEL_SRC_AUTO);
break;
case DISK_TYPE_PARTITION:
- rrdlabels_add(st->state->chart_labels, "device_type", "partition", RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device_type", "partition", RRDLABEL_SRC_AUTO);
break;
case DISK_TYPE_VIRTUAL:
- rrdlabels_add(st->state->chart_labels, "device_type", "virtual", RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device_type", "virtual", RRDLABEL_SRC_AUTO);
break;
}
}
@@ -1076,7 +1097,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_io)) {
d->st_io = rrdset_create_localhost(
RRD_TYPE_DISK
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.io"
@@ -1094,20 +1115,17 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_io);
}
- else rrdset_next(d->st_io);
last_readsectors = rrddim_set_by_pointer(d->st_io, d->rd_io_reads, readsectors);
last_writesectors = rrddim_set_by_pointer(d->st_io, d->rd_io_writes, writesectors);
rrdset_done(d->st_io);
}
- // --------------------------------------------------------------------
-
if (do_dc_stats && d->do_io == CONFIG_BOOLEAN_YES && d->do_ext != CONFIG_BOOLEAN_NO) {
if (unlikely(!d->st_ext_io)) {
d->st_ext_io = rrdset_create_localhost(
"disk_ext"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk_ext.io"
@@ -1123,15 +1141,12 @@ int do_proc_diskstats(int update_every, usec_t dt) {
d->rd_io_discards = rrddim_add(d->st_ext_io, "discards", NULL, d->sector_size, 1024, RRD_ALGORITHM_INCREMENTAL);
add_labels_to_disk(d, d->st_ext_io);
- } else
- rrdset_next(d->st_ext_io);
+ }
last_discardsectors = rrddim_set_by_pointer(d->st_ext_io, d->rd_io_discards, discardsectors);
rrdset_done(d->st_ext_io);
}
- // --------------------------------------------------------------------
-
if(d->do_ops == CONFIG_BOOLEAN_YES || (d->do_ops == CONFIG_BOOLEAN_AUTO &&
(reads || writes || discards || flushes ||
netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
@@ -1140,7 +1155,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_ops)) {
d->st_ops = rrdset_create_localhost(
"disk_ops"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.ops"
@@ -1160,20 +1175,17 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_ops);
}
- else rrdset_next(d->st_ops);
last_reads = rrddim_set_by_pointer(d->st_ops, d->rd_ops_reads, reads);
last_writes = rrddim_set_by_pointer(d->st_ops, d->rd_ops_writes, writes);
rrdset_done(d->st_ops);
}
- // --------------------------------------------------------------------
-
if (do_dc_stats && d->do_ops == CONFIG_BOOLEAN_YES && d->do_ext != CONFIG_BOOLEAN_NO) {
if (unlikely(!d->st_ext_ops)) {
d->st_ext_ops = rrdset_create_localhost(
"disk_ext_ops"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk_ext.ops"
@@ -1194,8 +1206,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_ext_ops);
}
- else
- rrdset_next(d->st_ext_ops);
last_discards = rrddim_set_by_pointer(d->st_ext_ops, d->rd_ops_discards, discards);
if (do_fl_stats)
@@ -1203,8 +1213,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
rrdset_done(d->st_ext_ops);
}
- // --------------------------------------------------------------------
-
if(d->do_qops == CONFIG_BOOLEAN_YES || (d->do_qops == CONFIG_BOOLEAN_AUTO &&
(queued_ios || netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
d->do_qops = CONFIG_BOOLEAN_YES;
@@ -1212,7 +1220,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_qops)) {
d->st_qops = rrdset_create_localhost(
"disk_qops"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.qops"
@@ -1231,14 +1239,11 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_qops);
}
- else rrdset_next(d->st_qops);
rrddim_set_by_pointer(d->st_qops, d->rd_qops_operations, queued_ios);
rrdset_done(d->st_qops);
}
- // --------------------------------------------------------------------
-
if(d->do_backlog == CONFIG_BOOLEAN_YES || (d->do_backlog == CONFIG_BOOLEAN_AUTO &&
(backlog_ms || netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
d->do_backlog = CONFIG_BOOLEAN_YES;
@@ -1246,7 +1251,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_backlog)) {
d->st_backlog = rrdset_create_localhost(
"disk_backlog"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.backlog"
@@ -1265,14 +1270,11 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_backlog);
}
- else rrdset_next(d->st_backlog);
rrddim_set_by_pointer(d->st_backlog, d->rd_backlog_backlog, backlog_ms);
rrdset_done(d->st_backlog);
}
- // --------------------------------------------------------------------
-
if(d->do_util == CONFIG_BOOLEAN_YES || (d->do_util == CONFIG_BOOLEAN_AUTO &&
(busy_ms || netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
d->do_util = CONFIG_BOOLEAN_YES;
@@ -1280,7 +1282,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_busy)) {
d->st_busy = rrdset_create_localhost(
"disk_busy"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.busy"
@@ -1299,17 +1301,14 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_busy);
}
- else rrdset_next(d->st_busy);
last_busy_ms = rrddim_set_by_pointer(d->st_busy, d->rd_busy_busy, busy_ms);
rrdset_done(d->st_busy);
- // --------------------------------------------------------------------
-
if(unlikely(!d->st_util)) {
d->st_util = rrdset_create_localhost(
"disk_util"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.util"
@@ -1328,7 +1327,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_util);
}
- else rrdset_next(d->st_util);
collected_number disk_utilization = (busy_ms - last_busy_ms) / (10 * update_every);
if (disk_utilization > 100)
@@ -1338,8 +1336,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
rrdset_done(d->st_util);
}
- // --------------------------------------------------------------------
-
if(d->do_mops == CONFIG_BOOLEAN_YES || (d->do_mops == CONFIG_BOOLEAN_AUTO &&
(mreads || mwrites || mdiscards ||
netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
@@ -1348,7 +1344,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_mops)) {
d->st_mops = rrdset_create_localhost(
"disk_mops"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.mops"
@@ -1368,22 +1364,19 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_mops);
}
- else rrdset_next(d->st_mops);
rrddim_set_by_pointer(d->st_mops, d->rd_mops_reads, mreads);
rrddim_set_by_pointer(d->st_mops, d->rd_mops_writes, mwrites);
rrdset_done(d->st_mops);
}
- // --------------------------------------------------------------------
-
if(do_dc_stats && d->do_mops == CONFIG_BOOLEAN_YES && d->do_ext != CONFIG_BOOLEAN_NO) {
d->do_mops = CONFIG_BOOLEAN_YES;
if(unlikely(!d->st_ext_mops)) {
d->st_ext_mops = rrdset_create_localhost(
"disk_ext_mops"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk_ext.mops"
@@ -1402,15 +1395,11 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_ext_mops);
}
- else
- rrdset_next(d->st_ext_mops);
rrddim_set_by_pointer(d->st_ext_mops, d->rd_mops_discards, mdiscards);
rrdset_done(d->st_ext_mops);
}
- // --------------------------------------------------------------------
-
if(d->do_iotime == CONFIG_BOOLEAN_YES || (d->do_iotime == CONFIG_BOOLEAN_AUTO &&
(readms || writems || discardms || flushms || netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
d->do_iotime = CONFIG_BOOLEAN_YES;
@@ -1418,7 +1407,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_iotime)) {
d->st_iotime = rrdset_create_localhost(
"disk_iotime"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.iotime"
@@ -1438,20 +1427,17 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_iotime);
}
- else rrdset_next(d->st_iotime);
last_readms = rrddim_set_by_pointer(d->st_iotime, d->rd_iotime_reads, readms);
last_writems = rrddim_set_by_pointer(d->st_iotime, d->rd_iotime_writes, writems);
rrdset_done(d->st_iotime);
}
- // --------------------------------------------------------------------
-
if(do_dc_stats && d->do_iotime == CONFIG_BOOLEAN_YES && d->do_ext != CONFIG_BOOLEAN_NO) {
if(unlikely(!d->st_ext_iotime)) {
d->st_ext_iotime = rrdset_create_localhost(
"disk_ext_iotime"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk_ext.iotime"
@@ -1472,8 +1458,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_ext_iotime);
}
- else
- rrdset_next(d->st_ext_iotime);
last_discardms = rrddim_set_by_pointer(d->st_ext_iotime, d->rd_iotime_discards, discardms);
if (do_fl_stats)
@@ -1481,7 +1465,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
rrdset_done(d->st_ext_iotime);
}
- // --------------------------------------------------------------------
// calculate differential charts
// only if this is not the first time we run
@@ -1496,7 +1479,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_await)) {
d->st_await = rrdset_create_localhost(
"disk_await"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.await"
@@ -1516,7 +1499,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_await);
}
- else rrdset_next(d->st_await);
rrddim_set_by_pointer(d->st_await, d->rd_await_reads, (reads - last_reads) ? (readms - last_readms) / (reads - last_reads) : 0);
rrddim_set_by_pointer(d->st_await, d->rd_await_writes, (writes - last_writes) ? (writems - last_writems) / (writes - last_writes) : 0);
@@ -1527,7 +1509,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_ext_await)) {
d->st_ext_await = rrdset_create_localhost(
"disk_ext_await"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk_ext.await"
@@ -1548,8 +1530,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_ext_await);
}
- else
- rrdset_next(d->st_ext_await);
rrddim_set_by_pointer(
d->st_ext_await, d->rd_await_discards,
@@ -1571,7 +1551,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_avgsz)) {
d->st_avgsz = rrdset_create_localhost(
"disk_avgsz"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.avgsz"
@@ -1591,7 +1571,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_avgsz);
}
- else rrdset_next(d->st_avgsz);
rrddim_set_by_pointer(d->st_avgsz, d->rd_avgsz_reads, (reads - last_reads) ? (readsectors - last_readsectors) / (reads - last_reads) : 0);
rrddim_set_by_pointer(d->st_avgsz, d->rd_avgsz_writes, (writes - last_writes) ? (writesectors - last_writesectors) / (writes - last_writes) : 0);
@@ -1602,7 +1581,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_ext_avgsz)) {
d->st_ext_avgsz = rrdset_create_localhost(
"disk_ext_avgsz"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk_ext.avgsz"
@@ -1621,8 +1600,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_ext_avgsz);
}
- else
- rrdset_next(d->st_ext_avgsz);
rrddim_set_by_pointer(
d->st_ext_avgsz, d->rd_avgsz_discards,
@@ -1641,7 +1618,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_svctm)) {
d->st_svctm = rrdset_create_localhost(
"disk_svctm"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.svctm"
@@ -1660,15 +1637,12 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_svctm);
}
- else
- rrdset_next(d->st_svctm);
rrddim_set_by_pointer(d->st_svctm, d->rd_svctm_svctm, ((reads - last_reads) + (writes - last_writes)) ? (busy_ms - last_busy_ms) / ((reads - last_reads) + (writes - last_writes)) : 0);
rrdset_done(d->st_svctm);
}
}
- // --------------------------------------------------------------------------
// read bcache metrics and generate the bcache charts
if(d->device_is_bcache && d->do_bcache != CONFIG_BOOLEAN_NO) {
@@ -1749,7 +1723,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_bcache_hit_ratio)) {
d->st_bcache_hit_ratio = rrdset_create_localhost(
"disk_bcache_hit_ratio"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.bcache_hit_ratio"
@@ -1769,8 +1743,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_bcache_hit_ratio);
}
- else
- rrdset_next(d->st_bcache_hit_ratio);
rrddim_set_by_pointer(d->st_bcache_hit_ratio, d->rd_bcache_hit_ratio_5min, stats_five_minute_cache_hit_ratio);
rrddim_set_by_pointer(d->st_bcache_hit_ratio, d->rd_bcache_hit_ratio_1hour, stats_hour_cache_hit_ratio);
@@ -1784,7 +1756,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_bcache_rates)) {
d->st_bcache_rates = rrdset_create_localhost(
"disk_bcache_rates"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.bcache_rates"
@@ -1802,8 +1774,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_bcache_rates);
}
- else
- rrdset_next(d->st_bcache_rates);
rrddim_set_by_pointer(d->st_bcache_rates, d->rd_bcache_rate_writeback, writeback_rate);
rrddim_set_by_pointer(d->st_bcache_rates, d->rd_bcache_rate_congested, cache_congested);
@@ -1814,7 +1784,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_bcache_size)) {
d->st_bcache_size = rrdset_create_localhost(
"disk_bcache_size"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.bcache_size"
@@ -1831,8 +1801,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_bcache_size);
}
- else
- rrdset_next(d->st_bcache_size);
rrddim_set_by_pointer(d->st_bcache_size, d->rd_bcache_dirty_size, dirty_data);
rrdset_done(d->st_bcache_size);
@@ -1842,7 +1810,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_bcache_usage)) {
d->st_bcache_usage = rrdset_create_localhost(
"disk_bcache_usage"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.bcache_usage"
@@ -1859,8 +1827,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_bcache_usage);
}
- else
- rrdset_next(d->st_bcache_usage);
rrddim_set_by_pointer(d->st_bcache_usage, d->rd_bcache_available_percent, cache_available_percent);
rrdset_done(d->st_bcache_usage);
@@ -1871,7 +1837,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_bcache_cache_read_races)) {
d->st_bcache_cache_read_races = rrdset_create_localhost(
"disk_bcache_cache_read_races"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.bcache_cache_read_races"
@@ -1889,8 +1855,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_bcache_cache_read_races);
}
- else
- rrdset_next(d->st_bcache_cache_read_races);
rrddim_set_by_pointer(d->st_bcache_cache_read_races, d->rd_bcache_cache_read_races, cache_read_races);
rrddim_set_by_pointer(d->st_bcache_cache_read_races, d->rd_bcache_cache_io_errors, cache_io_errors);
@@ -1906,7 +1870,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_bcache)) {
d->st_bcache = rrdset_create_localhost(
"disk_bcache"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.bcache"
@@ -1928,8 +1892,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_bcache);
}
- else
- rrdset_next(d->st_bcache);
rrddim_set_by_pointer(d->st_bcache, d->rd_bcache_hits, stats_total_cache_hits);
rrddim_set_by_pointer(d->st_bcache, d->rd_bcache_misses, stats_total_cache_misses);
@@ -1946,7 +1908,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
if(unlikely(!d->st_bcache_bypass)) {
d->st_bcache_bypass = rrdset_create_localhost(
"disk_bcache_bypass"
- , d->device
+ , d->chart_id
, d->disk
, family
, "disk.bcache_bypass"
@@ -1966,7 +1928,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
add_labels_to_disk(d, d->st_bcache_bypass);
}
- else rrdset_next(d->st_bcache_bypass);
rrddim_set_by_pointer(d->st_bcache_bypass, d->rd_bcache_bypass_hits, stats_total_cache_bypass_hits);
rrddim_set_by_pointer(d->st_bcache_bypass, d->rd_bcache_bypass_misses, stats_total_cache_bypass_misses);
@@ -1975,8 +1936,6 @@ int do_proc_diskstats(int update_every, usec_t dt) {
}
}
-
- // ------------------------------------------------------------------------
// update the system total I/O
if(global_do_io == CONFIG_BOOLEAN_YES || (global_do_io == CONFIG_BOOLEAN_AUTO &&
@@ -2004,15 +1963,12 @@ int do_proc_diskstats(int update_every, usec_t dt) {
rd_in = rrddim_add(st_io, "in", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
rd_out = rrddim_add(st_io, "out", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
}
- else rrdset_next(st_io);
rrddim_set_by_pointer(st_io, rd_in, system_read_kb);
rrddim_set_by_pointer(st_io, rd_out, system_write_kb);
rrdset_done(st_io);
}
-
- // ------------------------------------------------------------------------
// cleanup removed disks
struct disk *d = disk_root, *last = NULL;
@@ -2021,12 +1977,19 @@ int do_proc_diskstats(int update_every, usec_t dt) {
struct disk *t = d;
rrdset_obsolete_and_pointer_null(d->st_avgsz);
+ rrdset_obsolete_and_pointer_null(d->st_ext_avgsz);
rrdset_obsolete_and_pointer_null(d->st_await);
+ rrdset_obsolete_and_pointer_null(d->st_ext_await);
rrdset_obsolete_and_pointer_null(d->st_backlog);
+ rrdset_obsolete_and_pointer_null(d->st_busy);
rrdset_obsolete_and_pointer_null(d->st_io);
+ rrdset_obsolete_and_pointer_null(d->st_ext_io);
rrdset_obsolete_and_pointer_null(d->st_iotime);
+ rrdset_obsolete_and_pointer_null(d->st_ext_iotime);
rrdset_obsolete_and_pointer_null(d->st_mops);
+ rrdset_obsolete_and_pointer_null(d->st_ext_mops);
rrdset_obsolete_and_pointer_null(d->st_ops);
+ rrdset_obsolete_and_pointer_null(d->st_ext_ops);
rrdset_obsolete_and_pointer_null(d->st_qops);
rrdset_obsolete_and_pointer_null(d->st_svctm);
rrdset_obsolete_and_pointer_null(d->st_util);
@@ -2036,6 +1999,8 @@ int do_proc_diskstats(int update_every, usec_t dt) {
rrdset_obsolete_and_pointer_null(d->st_bcache_size);
rrdset_obsolete_and_pointer_null(d->st_bcache_usage);
rrdset_obsolete_and_pointer_null(d->st_bcache_hit_ratio);
+ rrdset_obsolete_and_pointer_null(d->st_bcache_cache_allocations);
+ rrdset_obsolete_and_pointer_null(d->st_bcache_cache_read_races);
if(d == disk_root) {
disk_root = d = d->next;
@@ -2066,6 +2031,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
freez(t->disk);
freez(t->device);
freez(t->mount_point);
+ freez(t->chart_id);
freez(t);
}
else {