File ganglia-0025-Report-the-Linux-specific-slab-memory-metric.patch of Package ganglia (Revision 75b931bb89f8b1f8f866553cb946391e)
Currently displaying revision 75b931bb89f8b1f8f866553cb946391e , Show latest
67
1
From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= <anders.f.bjorklund@gmail.com>
2
Date: Sat, 3 Feb 2018 15:32:38 +0100
3
Git-commit: c245a5a775cd327d69782fb65536cf037c7873e5
4
References: bsc#1087487
5
Subject: [PATCH] Report the Linux-specific slab memory metric
6
7
According to later versions of procps, the top(1) value for "buff/cache"
8
memory is supposed in addition to Buffers/Cached to also include Slab.
9
10
Interestingly, the biggest impact of this is in the "used" memory shown
11
since that value is not reported but just calculated using the others:
12
13
// {"Cached", &kb_page_cache},
14
kb_main_cached = kb_page_cache + kb_slab;
15
kb_swap_used = kb_swap_total - kb_swap_free;
16
kb_main_used = kb_main_total - kb_main_free - kb_main_cached - kb_main_buffers;
17
18
In order to have more accurate memory reporting on Linux, make sure to
19
include this metric in the default configuration for the memory module.
20
Acked-by: John Jolly <jjolly@suse.de>
21
---
22
lib/default_conf.h.in | 13 +++++++++++++
23
lib/libgmond.c | 3 +++
24
2 files changed, 16 insertions(+)
25
26
diff --git a/lib/default_conf.h.in b/lib/default_conf.h.in
27
index 568c246f..44f87ce7 100644
28
--- a/lib/default_conf.h.in
29
+++ b/lib/default_conf.h.in
30
31
\n\
32
"
33
34
+#define LINUX_SPECIFIC_CONFIGURATION "\
35
+collection_group {\n\
36
+ collect_every = 40\n\
37
+ time_threshold = 180\n\
38
+ metric {\n\
39
+ name = \"mem_slab\"\n\
40
+ value_threshold = \"1024.0\"\n\
41
+ title = \"Slab Memory\"\n\
42
+ }\n\
43
+}\n\
44
+\n\
45
+"
46
+
47
#define SOLARIS_SPECIFIC_CONFIGURATION "\
48
/* solaris specific metrics begin */\n\
49
collection_group {\n\
50
diff --git a/lib/libgmond.c b/lib/libgmond.c
51
index f5eb32f1..c6267939 100644
52
--- a/lib/libgmond.c
53
+++ b/lib/libgmond.c
54
55
default_gmond_configuration = apr_pstrcat(context, default_gmond_configuration, SFLOW_CONFIGURATION, NULL);
56
#endif
57
default_gmond_configuration = apr_pstrcat(context, default_gmond_configuration, COLLECTION_GROUP_LIST, NULL);
58
+#if LINUX
59
+ default_gmond_configuration = apr_pstrcat(context, default_gmond_configuration, LINUX_SPECIFIC_CONFIGURATION, NULL);
60
+#endif
61
#if SOLARIS
62
default_gmond_configuration = apr_pstrcat(context, default_gmond_configuration, SOLARIS_SPECIFIC_CONFIGURATION, NULL);
63
#endif
64
--
65
2.13.6
66
67