diff options
Diffstat (limited to 'src/collectors/common-contexts')
18 files changed, 357 insertions, 15 deletions
diff --git a/src/collectors/common-contexts/common-contexts.h b/src/collectors/common-contexts/common-contexts.h index 1938230dc..4c7e58e7f 100644 --- a/src/collectors/common-contexts/common-contexts.h +++ b/src/collectors/common-contexts/common-contexts.h @@ -18,14 +18,22 @@ typedef void (*instance_labels_cb_t)(RRDSET *st, void *data);
-#include "system.io.h"
-#include "system.ram.h"
-#include "system.interrupts.h"
-#include "system.processes.h"
-#include "system.ipc.h"
-#include "mem.swap.h"
-#include "mem.pgfaults.h"
-#include "mem.available.h"
-#include "disk.io.h"
+#include "system-io.h"
+#include "system-ram.h"
+#include "system-interrupts.h"
+#include "system-processes.h"
+#include "system-ipc.h"
+#include "mem-swap.h"
+#include "mem-pgfaults.h"
+#include "mem-available.h"
+#include "disk-io.h"
+#include "disk-ops.h"
+#include "disk-qops.h"
+#include "disk-util.h"
+#include "disk-busy.h"
+#include "disk-iotime.h"
+#include "disk-await.h"
+#include "disk-svctm.h"
+#include "disk-avgsz.h"
#endif //NETDATA_COMMON_CONTEXTS_H
diff --git a/src/collectors/common-contexts/disk-avgsz.h b/src/collectors/common-contexts/disk-avgsz.h new file mode 100644 index 000000000..16cca247a --- /dev/null +++ b/src/collectors/common-contexts/disk-avgsz.h @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef NETDATA_DISK_AVGSZ_H
+#define NETDATA_DISK_AVGSZ_H
+
+#include "common-contexts.h"
+
+typedef struct {
+ RRDSET *st_avgsz;
+ RRDDIM *rd_avgsz_reads;
+ RRDDIM *rd_avgsz_writes;
+} ND_DISK_AVGSZ;
+
+static inline void common_disk_avgsz(ND_DISK_AVGSZ *d, const char *id, const char *name, uint64_t avg_bytes_read, uint64_t avg_bytes_write, int update_every, instance_labels_cb_t cb, void *data) {
+ if(unlikely(!d->st_avgsz)) {
+ d->st_avgsz = rrdset_create_localhost(
+ "disk_avgsz"
+ , id
+ , name
+ , "io"
+ , "disk.avgsz"
+ , "Average Completed I/O Operation Bandwidth"
+ , "KiB/operation"
+ , _COMMON_PLUGIN_NAME
+ , _COMMON_PLUGIN_MODULE_NAME
+ , NETDATA_CHART_PRIO_DISK_AVGSZ
+ , update_every
+ , RRDSET_TYPE_AREA
+ );
+
+ d->rd_avgsz_reads = rrddim_add(d->st_avgsz, "reads", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
+ d->rd_avgsz_writes = rrddim_add(d->st_avgsz, "writes", NULL, -1, 1024, RRD_ALGORITHM_ABSOLUTE);
+
+ if(cb)
+ cb(d->st_avgsz, data);
+ }
+
+ // this always have to be in base units, so that exporting sends base units to other time-series db
+ rrddim_set_by_pointer(d->st_avgsz, d->rd_avgsz_reads, (collected_number)avg_bytes_read);
+ rrddim_set_by_pointer(d->st_avgsz, d->rd_avgsz_writes, (collected_number)avg_bytes_write);
+ rrdset_done(d->st_avgsz);
+}
+
+#endif //NETDATA_DISK_AVGSZ_H
diff --git a/src/collectors/common-contexts/disk-await.h b/src/collectors/common-contexts/disk-await.h new file mode 100644 index 000000000..b4142569e --- /dev/null +++ b/src/collectors/common-contexts/disk-await.h @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef NETDATA_DISK_AWAIT_H
+#define NETDATA_DISK_AWAIT_H
+
+#include "common-contexts.h"
+
+typedef struct {
+ RRDSET *st_await;
+ RRDDIM *rd_await_reads;
+ RRDDIM *rd_await_writes;
+} ND_DISK_AWAIT;
+
+static inline void common_disk_await(ND_DISK_AWAIT *d, const char *id, const char *name, double read_avg_ms, double write_avg_ms, int update_every, instance_labels_cb_t cb, void *data) {
+ if(unlikely(!d->st_await)) {
+ d->st_await = rrdset_create_localhost(
+ "disk_await"
+ , id
+ , name
+ , "latency"
+ , "disk.await"
+ , "Average Completed I/O Operation Time"
+ , "milliseconds/operation"
+ , _COMMON_PLUGIN_NAME
+ , _COMMON_PLUGIN_MODULE_NAME
+ , NETDATA_CHART_PRIO_DISK_AWAIT
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ d->rd_await_reads = rrddim_add(d->st_await, "reads", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
+ d->rd_await_writes = rrddim_add(d->st_await, "writes", NULL, -1, 1000, RRD_ALGORITHM_ABSOLUTE);
+
+ if(cb)
+ cb(d->st_await, data);
+ }
+
+ // this always have to be in base units, so that exporting sends base units to other time-series db
+ rrddim_set_by_pointer(d->st_await, d->rd_await_reads, (collected_number)(read_avg_ms * 1000.0));
+ rrddim_set_by_pointer(d->st_await, d->rd_await_writes, (collected_number)(write_avg_ms * 1000.0));
+ rrdset_done(d->st_await);
+}
+
+#endif //NETDATA_DISK_AWAIT_H
diff --git a/src/collectors/common-contexts/disk-busy.h b/src/collectors/common-contexts/disk-busy.h new file mode 100644 index 000000000..92679d9ef --- /dev/null +++ b/src/collectors/common-contexts/disk-busy.h @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef NETDATA_DISK_BUSY_H
+#define NETDATA_DISK_BUSY_H
+
+#include "common-contexts.h"
+
+typedef struct {
+ RRDSET *st_busy;
+ RRDDIM *rd_busy;
+} ND_DISK_BUSY;
+
+static inline void common_disk_busy(ND_DISK_BUSY *d, const char *id, const char *name, uint64_t busy_ms, int update_every, instance_labels_cb_t cb, void *data) {
+ if(unlikely(!d->st_busy)) {
+ d->st_busy = rrdset_create_localhost(
+ "disk_busy"
+ , id
+ , name
+ , "utilization"
+ , "disk.busy"
+ , "Disk Busy Time"
+ , "milliseconds"
+ , _COMMON_PLUGIN_NAME
+ , _COMMON_PLUGIN_MODULE_NAME
+ , NETDATA_CHART_PRIO_DISK_BUSY
+ , update_every
+ , RRDSET_TYPE_AREA
+ );
+
+ d->rd_busy = rrddim_add(d->st_busy, "busy", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+
+ if(cb)
+ cb(d->st_busy, data);
+ }
+
+ // this always have to be in base units, so that exporting sends base units to other time-series db
+ rrddim_set_by_pointer(d->st_busy, d->rd_busy, (collected_number)busy_ms);
+ rrdset_done(d->st_busy);
+}
+
+#endif //NETDATA_DISK_BUSY_H
diff --git a/src/collectors/common-contexts/disk.io.h b/src/collectors/common-contexts/disk-io.h index 26f98b9be..26f98b9be 100644 --- a/src/collectors/common-contexts/disk.io.h +++ b/src/collectors/common-contexts/disk-io.h diff --git a/src/collectors/common-contexts/disk-iotime.h b/src/collectors/common-contexts/disk-iotime.h new file mode 100644 index 000000000..29707287a --- /dev/null +++ b/src/collectors/common-contexts/disk-iotime.h @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef NETDATA_DISK_IOTIME_H
+#define NETDATA_DISK_IOTIME_H
+
+#include "common-contexts.h"
+
+typedef struct {
+ RRDSET *st_iotime;
+ RRDDIM *rd_reads_ms;
+ RRDDIM *rd_writes_ms;
+} ND_DISK_IOTIME;
+
+static inline void common_disk_iotime(ND_DISK_IOTIME *d, const char *id, const char *name, uint64_t reads_ms, uint64_t writes_ms, int update_every, instance_labels_cb_t cb, void *data) {
+ if(unlikely(!d->st_iotime)) {
+ d->st_iotime = rrdset_create_localhost(
+ "disk_iotime"
+ , id
+ , name
+ , "utilization"
+ , "disk.iotime"
+ , "Disk Total I/O Time"
+ , "milliseconds/s"
+ , _COMMON_PLUGIN_NAME
+ , _COMMON_PLUGIN_MODULE_NAME
+ , NETDATA_CHART_PRIO_DISK_IOTIME
+ , update_every
+ , RRDSET_TYPE_AREA
+ );
+
+ d->rd_reads_ms = rrddim_add(d->st_iotime, "reads", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ d->rd_writes_ms = rrddim_add(d->st_iotime, "writes", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+
+ if(cb)
+ cb(d->st_iotime, data);
+ }
+
+ // this always have to be in base units, so that exporting sends base units to other time-series db
+ rrddim_set_by_pointer(d->st_iotime, d->rd_reads_ms, (collected_number)reads_ms);
+ rrddim_set_by_pointer(d->st_iotime, d->rd_writes_ms, (collected_number)writes_ms);
+ rrdset_done(d->st_iotime);
+}
+
+#endif //NETDATA_DISK_IOTIME_H
diff --git a/src/collectors/common-contexts/disk-ops.h b/src/collectors/common-contexts/disk-ops.h new file mode 100644 index 000000000..6e1ac4690 --- /dev/null +++ b/src/collectors/common-contexts/disk-ops.h @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef NETDATA_DISK_OPS_H
+#define NETDATA_DISK_OPS_H
+
+#include "common-contexts.h"
+
+typedef struct {
+ RRDSET *st_ops;
+ RRDDIM *rd_ops_reads;
+ RRDDIM *rd_ops_writes;
+} ND_DISK_OPS;
+
+static inline void common_disk_ops(ND_DISK_OPS *d, const char *id, const char *name, uint64_t ops_read, uint64_t ops_write, int update_every, instance_labels_cb_t cb, void *data) {
+ if(unlikely(!d->st_ops)) {
+ d->st_ops = rrdset_create_localhost(
+ "disk_ops"
+ , id
+ , name
+ , "ops"
+ , "disk.ops"
+ , "Disk Completed I/O Operations"
+ , "operations/s"
+ , _COMMON_PLUGIN_NAME
+ , _COMMON_PLUGIN_MODULE_NAME
+ , NETDATA_CHART_PRIO_DISK_OPS
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ d->rd_ops_reads = rrddim_add(d->st_ops, "reads", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ d->rd_ops_writes = rrddim_add(d->st_ops, "writes", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+
+ if(cb)
+ cb(d->st_ops, data);
+ }
+
+ // this always have to be in base units, so that exporting sends base units to other time-series db
+ rrddim_set_by_pointer(d->st_ops, d->rd_ops_reads, (collected_number)ops_read);
+ rrddim_set_by_pointer(d->st_ops, d->rd_ops_writes, (collected_number)ops_write);
+ rrdset_done(d->st_ops);
+}
+
+#endif //NETDATA_DISK_OPS_H
diff --git a/src/collectors/common-contexts/disk-qops.h b/src/collectors/common-contexts/disk-qops.h new file mode 100644 index 000000000..89f38cb27 --- /dev/null +++ b/src/collectors/common-contexts/disk-qops.h @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef NETDATA_DISK_QOPS_H
+#define NETDATA_DISK_QOPS_H
+
+#include "common-contexts.h"
+
+typedef struct {
+ RRDSET *st_qops;
+ RRDDIM *rd_qops;
+} ND_DISK_QOPS;
+
+static inline void common_disk_qops(ND_DISK_QOPS *d, const char *id, const char *name, uint64_t queued_ops, int update_every, instance_labels_cb_t cb, void *data) {
+ if(unlikely(!d->st_qops)) {
+ d->st_qops = rrdset_create_localhost(
+ "disk_qops"
+ , id
+ , name
+ , "ops"
+ , "disk.qops"
+ , "Disk Current I/O Operations"
+ , "operations"
+ , _COMMON_PLUGIN_NAME
+ , _COMMON_PLUGIN_MODULE_NAME
+ , NETDATA_CHART_PRIO_DISK_QOPS
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ d->rd_qops = rrddim_add(d->st_qops, "operations", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
+
+ if(cb)
+ cb(d->st_qops, data);
+ }
+
+ // this always have to be in base units, so that exporting sends base units to other time-series db
+ rrddim_set_by_pointer(d->st_qops, d->rd_qops, (collected_number)queued_ops);
+ rrdset_done(d->st_qops);
+}
+
+#endif //NETDATA_DISK_QOPS_H
diff --git a/src/collectors/common-contexts/disk-svctm.h b/src/collectors/common-contexts/disk-svctm.h new file mode 100644 index 000000000..f1d07c150 --- /dev/null +++ b/src/collectors/common-contexts/disk-svctm.h @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef NETDATA_DISK_SVCTM_H
+#define NETDATA_DISK_SVCTM_H
+
+#include "common-contexts.h"
+
+typedef struct {
+ RRDSET *st_svctm;
+ RRDDIM *rd_svctm;
+} ND_DISK_SVCTM;
+
+static inline void common_disk_svctm(ND_DISK_SVCTM *d, const char *id, const char *name, double svctm_ms, int update_every, instance_labels_cb_t cb, void *data) {
+ if(unlikely(!d->st_svctm)) {
+ d->st_svctm = rrdset_create_localhost(
+ "disk_svctm"
+ , id
+ , name
+ , "latency"
+ , "disk.svctm"
+ , "Average Service Time"
+ , "milliseconds/operation"
+ , _COMMON_PLUGIN_NAME
+ , _COMMON_PLUGIN_MODULE_NAME
+ , NETDATA_CHART_PRIO_DISK_SVCTM
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ d->rd_svctm = rrddim_add(d->st_svctm, "svctm", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
+
+ if(cb)
+ cb(d->st_svctm, data);
+ }
+
+ // this always have to be in base units, so that exporting sends base units to other time-series db
+ rrddim_set_by_pointer(d->st_svctm, d->rd_svctm, (collected_number)(svctm_ms * 1000.0));
+ rrdset_done(d->st_svctm);
+}
+
+#endif //NETDATA_DISK_SVCTM_H
diff --git a/src/collectors/common-contexts/disk-util.h b/src/collectors/common-contexts/disk-util.h new file mode 100644 index 000000000..8733975f6 --- /dev/null +++ b/src/collectors/common-contexts/disk-util.h @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef NETDATA_DISK_UTIL_H
+#define NETDATA_DISK_UTIL_H
+
+#include "common-contexts.h"
+
+typedef struct {
+ RRDSET *st_util;
+ RRDDIM *rd_util;
+} ND_DISK_UTIL;
+
+static inline void common_disk_util(ND_DISK_UTIL *d, const char *id, const char *name, uint64_t percent, int update_every, instance_labels_cb_t cb, void *data) {
+ if(unlikely(!d->st_util)) {
+ d->st_util = rrdset_create_localhost(
+ "disk_util"
+ , id
+ , name
+ , "utilization"
+ , "disk.util"
+ , "Disk Utilization Time"
+ , "% of time working"
+ , _COMMON_PLUGIN_NAME
+ , _COMMON_PLUGIN_MODULE_NAME
+ , NETDATA_CHART_PRIO_DISK_UTIL
+ , update_every
+ , RRDSET_TYPE_AREA
+ );
+
+ d->rd_util = rrddim_add(d->st_util, "utilization", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
+
+ if(cb)
+ cb(d->st_util, data);
+ }
+
+ // this always have to be in base units, so that exporting sends base units to other time-series db
+ rrddim_set_by_pointer(d->st_util, d->rd_util, (collected_number)percent);
+ rrdset_done(d->st_util);
+}
+
+#endif //NETDATA_DISK_UTIL_H
diff --git a/src/collectors/common-contexts/mem.available.h b/src/collectors/common-contexts/mem-available.h index 3f763fe18..3f763fe18 100644 --- a/src/collectors/common-contexts/mem.available.h +++ b/src/collectors/common-contexts/mem-available.h diff --git a/src/collectors/common-contexts/mem.pgfaults.h b/src/collectors/common-contexts/mem-pgfaults.h index 503b9f7e8..8a10449e6 100644 --- a/src/collectors/common-contexts/mem.pgfaults.h +++ b/src/collectors/common-contexts/mem-pgfaults.h @@ -25,8 +25,6 @@ static inline void common_mem_pgfaults(uint64_t minor, uint64_t major, int updat , RRDSET_TYPE_LINE
);
- rrdset_flag_set(st_pgfaults, RRDSET_FLAG_DETAIL);
-
rd_minor = rrddim_add(st_pgfaults, "minor", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
rd_major = rrddim_add(st_pgfaults, "major", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
}
diff --git a/src/collectors/common-contexts/mem.swap.h b/src/collectors/common-contexts/mem-swap.h index 1c1b053d7..d4c0cfc89 100644 --- a/src/collectors/common-contexts/mem.swap.h +++ b/src/collectors/common-contexts/mem-swap.h @@ -30,8 +30,6 @@ static inline void common_mem_swap(uint64_t free_bytes, uint64_t used_bytes, int , RRDSET_TYPE_STACKED
);
- rrdset_flag_set(st_system_swap, RRDSET_FLAG_DETAIL);
-
rd_free = rrddim_add(st_system_swap, "free", NULL, 1, 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
rd_used = rrddim_add(st_system_swap, "used", NULL, 1, 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
}
diff --git a/src/collectors/common-contexts/system.interrupts.h b/src/collectors/common-contexts/system-interrupts.h index dffd70572..4b78e9469 100644 --- a/src/collectors/common-contexts/system.interrupts.h +++ b/src/collectors/common-contexts/system-interrupts.h @@ -27,8 +27,6 @@ static inline void common_interrupts(uint64_t interrupts, int update_every, char , update_every
, RRDSET_TYPE_LINE);
- rrdset_flag_set(st_intr, RRDSET_FLAG_DETAIL);
-
rd_interrupts = rrddim_add(st_intr, "interrupts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
}
diff --git a/src/collectors/common-contexts/system.io.h b/src/collectors/common-contexts/system-io.h index 84440c9b8..84440c9b8 100644 --- a/src/collectors/common-contexts/system.io.h +++ b/src/collectors/common-contexts/system-io.h diff --git a/src/collectors/common-contexts/system.ipc.h b/src/collectors/common-contexts/system-ipc.h index 129ce6dfa..129ce6dfa 100644 --- a/src/collectors/common-contexts/system.ipc.h +++ b/src/collectors/common-contexts/system-ipc.h diff --git a/src/collectors/common-contexts/system.processes.h b/src/collectors/common-contexts/system-processes.h index 1b886d65f..1b886d65f 100644 --- a/src/collectors/common-contexts/system.processes.h +++ b/src/collectors/common-contexts/system-processes.h diff --git a/src/collectors/common-contexts/system.ram.h b/src/collectors/common-contexts/system-ram.h index 6b108405c..6b108405c 100644 --- a/src/collectors/common-contexts/system.ram.h +++ b/src/collectors/common-contexts/system-ram.h |