summaryrefslogtreecommitdiffstats
path: root/src/ipc.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:19:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:20:17 +0000
commita64a253794ac64cb40befee54db53bde17dd0d49 (patch)
treec1024acc5f6e508814b944d99f112259bb28b1be /src/ipc.c
parentNew upstream version 1.10.0+dfsg (diff)
downloadnetdata-upstream/1.11.0+dfsg.tar.xz
netdata-upstream/1.11.0+dfsg.zip
New upstream version 1.11.0+dfsgupstream/1.11.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--collectors/proc.plugin/ipc.c (renamed from src/ipc.c)22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/ipc.c b/collectors/proc.plugin/ipc.c
index a9076fca4..6c6bee519 100644
--- a/src/ipc.c
+++ b/collectors/proc.plugin/ipc.c
@@ -1,4 +1,6 @@
-#include "common.h"
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "plugin_proc.h"
#include <sys/sem.h>
#include <sys/msg.h>
@@ -166,7 +168,7 @@ int do_ipc(int update_every, usec_t dt) {
static int initialized = 0, read_limits_next = -1;
static struct ipc_limits limits;
static struct ipc_status status;
- static RRDSETVAR *arrays_max = NULL, *semaphores_max = NULL;
+ static RRDVAR *arrays_max = NULL, *semaphores_max = NULL;
static RRDSET *st_semaphores = NULL, *st_arrays = NULL;
static RRDDIM *rd_semaphores = NULL, *rd_arrays = NULL;
@@ -195,9 +197,9 @@ int do_ipc(int update_every, usec_t dt) {
, NULL
, "IPC Semaphores"
, "semaphores"
- , "linux"
+ , PLUGIN_PROC_NAME
, "ipc"
- , 1000
+ , NETDATA_CHART_PRIO_SYSTEM_IPC_SEMAPHORES
, localhost->rrd_update_every
, RRDSET_TYPE_AREA
);
@@ -213,9 +215,9 @@ int do_ipc(int update_every, usec_t dt) {
, NULL
, "IPC Semaphore Arrays"
, "arrays"
- , "linux"
+ , PLUGIN_PROC_NAME
, "ipc"
- , 1000
+ , NETDATA_CHART_PRIO_SYSTEM_IPC_SEM_ARRAYS
, localhost->rrd_update_every
, RRDSET_TYPE_AREA
);
@@ -223,8 +225,8 @@ int do_ipc(int update_every, usec_t dt) {
}
// variables
- semaphores_max = rrdsetvar_custom_chart_variable_create(st_semaphores, "ipc.semaphores.max");
- arrays_max = rrdsetvar_custom_chart_variable_create(st_arrays, "ipc.semaphores.arrays.max");
+ semaphores_max = rrdvar_custom_host_variable_create(localhost, "ipc_semaphores_max");
+ arrays_max = rrdvar_custom_host_variable_create(localhost, "ipc_semaphores_arrays_max");
}
if(unlikely(read_limits_next < 0)) {
@@ -232,8 +234,8 @@ int do_ipc(int update_every, usec_t dt) {
error("Unable to fetch semaphore limits.");
}
else {
- if(semaphores_max) rrdsetvar_custom_chart_variable_set(semaphores_max, limits.semmns);
- if(arrays_max) rrdsetvar_custom_chart_variable_set(arrays_max, limits.semmni);
+ if(semaphores_max) rrdvar_custom_host_variable_set(localhost, semaphores_max, limits.semmns);
+ if(arrays_max) rrdvar_custom_host_variable_set(localhost, arrays_max, limits.semmni);
st_arrays->red = limits.semmni;
st_semaphores->red = limits.semmns;