proc integrations (#15494)
Co-authored-by: ilyam8 <ilya@netdata.cloud>
Costa Tsaousis committed
Jul 26, 2023 at 01:06 UTC
065091c3f5d908c5e06ed5ac817999f7dc965b90
12 files changed
+1088
-252
collectors/all.h
+26
-20
@@ -23,18 +23,6 @@
23
#define NETDATA_CHART_PRIO_SYSTEM_IO 150
24
#define NETDATA_CHART_PRIO_SYSTEM_PGPGIO 151
25
#define NETDATA_CHART_PRIO_SYSTEM_RAM 200
26
-#define NETDATA_CHART_PRIO_SYSTEM_SWAP 201
27
-#define NETDATA_CHART_PRIO_SYSTEM_SWAP_CALLS 202
28
-#define NETDATA_CHART_PRIO_SYSTEM_SWAPIO 250
29
-#define NETDATA_CHART_PRIO_SYSTEM_ZSWAPIO 300
30
-#define NETDATA_CHART_PRIO_SYSTEM_ZSWAP_COMPRESS_RATIO 301
31
-#define NETDATA_CHART_PRIO_SYSTEM_ZSWAP_POOL_TOT_SIZE 302
32
-#define NETDATA_CHART_PRIO_SYSTEM_ZSWAP_STORED_PAGE 303
33
-#define NETDATA_CHART_PRIO_SYSTEM_ZSWAP_REJECTS 304
34
-#define NETDATA_CHART_PRIO_SYSTEM_ZSWAP_POOL_LIM_HIT 305
35
-#define NETDATA_CHART_PRIO_SYSTEM_ZSWAP_WRT_BACK_PAGES 306
36
-#define NETDATA_CHART_PRIO_SYSTEM_ZSWAP_SAME_FILL_PAGE 307
37
-#define NETDATA_CHART_PRIO_SYSTEM_ZSWAP_DUPP_ENTRY 308
26
#define NETDATA_CHART_PRIO_SYSTEM_NET 500
27
#define NETDATA_CHART_PRIO_SYSTEM_IPV4 500 // freebsd only
28
#define NETDATA_CHART_PRIO_SYSTEM_IP 501
@@ -87,17 +75,35 @@
75
#define NETDATA_CHART_PRIO_MEM_SYSTEM_AVAILABLE 1010
76
#define NETDATA_CHART_PRIO_MEM_SYSTEM_OOM_KILL 1020
77
#define NETDATA_CHART_PRIO_MEM_SYSTEM_COMMITTED 1030
90
-#define NETDATA_CHART_PRIO_MEM_SYSTEM_PGFAULTS 1040
78
+#define NETDATA_CHART_PRIO_MEM_SWAP 1035
79
+#define NETDATA_CHART_PRIO_MEM_SWAP_CALLS 1037
80
+#define NETDATA_CHART_PRIO_MEM_SWAPIO 1038
81
+#define NETDATA_CHART_PRIO_MEM_ZSWAP 1036
82
+#define NETDATA_CHART_PRIO_MEM_ZSWAPIO 1037
83
+#define NETDATA_CHART_PRIO_MEM_ZSWAP_COMPRESS_RATIO 1038
84
+#define NETDATA_CHART_PRIO_MEM_ZSWAP_POOL_TOT_SIZE 1039
85
+#define NETDATA_CHART_PRIO_MEM_ZSWAP_STORED_PAGE 1040
86
+#define NETDATA_CHART_PRIO_MEM_ZSWAP_REJECTS 1041
87
+#define NETDATA_CHART_PRIO_MEM_ZSWAP_POOL_LIM_HIT 1042
88
+#define NETDATA_CHART_PRIO_MEM_ZSWAP_WRT_BACK_PAGES 1043
89
+#define NETDATA_CHART_PRIO_MEM_ZSWAP_SAME_FILL_PAGE 1044
90
+#define NETDATA_CHART_PRIO_MEM_ZSWAP_DUPP_ENTRY 1045
91
+#define NETDATA_CHART_PRIO_MEM_SYSTEM_PGFAULTS 1050
92
#define NETDATA_CHART_PRIO_MEM_KERNEL 1100
93
#define NETDATA_CHART_PRIO_MEM_SLAB 1200
94
+#define NETDATA_CHART_PRIO_MEM_RECLAIMING 1210
95
+#define NETDATA_CHART_PRIO_MEM_HIGH_LOW 1211
96
+#define NETDATA_CHART_PRIO_MEM_CMA 1212
97
#define NETDATA_CHART_PRIO_MEM_HUGEPAGES 1250
94
-#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_FAULTS 1251
95
-#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_FILE 1252
96
-#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_ZERO 1253
97
-#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_KHUGEPAGED 1254
98
-#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_SPLITS 1255
99
-#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_SWAPOUT 1256
100
-#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_COMPACT 1257
98
+#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_DETAILS 1251
99
+#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_FAULTS 1252
100
+#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_FILE 1253
101
+#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_ZERO 1254
102
+#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_KHUGEPAGED 1255
103
+#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_SPLITS 1256
104
+#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_SWAPOUT 1257
105
+#define NETDATA_CHART_PRIO_MEM_HUGEPAGES_COMPACT 1258
106
+#define NETDATA_CHART_PRIO_MEM_DIRECTMAP 1260
107
#define NETDATA_CHART_PRIO_MEM_KSM 1300
108
#define NETDATA_CHART_PRIO_MEM_KSM_SAVINGS 1301
109
#define NETDATA_CHART_PRIO_MEM_KSM_RATIOS 1302
collectors/cgroups.plugin/sys_fs_cgroup.c
+146
-18
@@ -62,6 +62,8 @@ static int cgroup_enable_pressure_io_some = CONFIG_BOOLEAN_AUTO;
62
static int cgroup_enable_pressure_io_full = CONFIG_BOOLEAN_AUTO;
63
static int cgroup_enable_pressure_memory_some = CONFIG_BOOLEAN_AUTO;
64
static int cgroup_enable_pressure_memory_full = CONFIG_BOOLEAN_AUTO;
65
+static int cgroup_enable_pressure_irq_some = CONFIG_BOOLEAN_NO;
66
+static int cgroup_enable_pressure_irq_full = CONFIG_BOOLEAN_AUTO;
67
68
static int cgroup_enable_systemd_services = CONFIG_BOOLEAN_YES;
69
static int cgroup_enable_systemd_services_detailed_memory = CONFIG_BOOLEAN_NO;
@@ -828,6 +830,7 @@ struct cgroup {
830
struct pressure cpu_pressure;
831
struct pressure io_pressure;
832
struct pressure memory_pressure;
833
+ struct pressure irq_pressure;
834
835
// per cgroup charts
836
RRDSET *st_cpu;
@@ -1451,28 +1454,33 @@ static inline void cgroup2_read_pressure(struct pressure *res) {
1454
return;
1455
}
1456
1454
- res->some.share_time.value10 = strtod(procfile_lineword(ff, 0, 2), NULL);
1455
- res->some.share_time.value60 = strtod(procfile_lineword(ff, 0, 4), NULL);
1456
- res->some.share_time.value300 = strtod(procfile_lineword(ff, 0, 6), NULL);
1457
- res->some.total_time.value_total = str2ull(procfile_lineword(ff, 0, 8), NULL) / 1000; // us->ms
1457
+ bool did_some = false, did_full = false;
1458
1459
- if (lines > 2) {
1460
- res->full.share_time.value10 = strtod(procfile_lineword(ff, 1, 2), NULL);
1461
- res->full.share_time.value60 = strtod(procfile_lineword(ff, 1, 4), NULL);
1462
- res->full.share_time.value300 = strtod(procfile_lineword(ff, 1, 6), NULL);
1463
- res->full.total_time.value_total = str2ull(procfile_lineword(ff, 1, 8), NULL) / 1000; // us->ms
1459
+ for(size_t l = 0; l < lines ;l++) {
1460
+ const char *key = procfile_lineword(ff, l, 0);
1461
+ if(strcmp(key, "some") == 0) {
1462
+ res->some.share_time.value10 = strtod(procfile_lineword(ff, l, 2), NULL);
1463
+ res->some.share_time.value60 = strtod(procfile_lineword(ff, l, 4), NULL);
1464
+ res->some.share_time.value300 = strtod(procfile_lineword(ff, l, 6), NULL);
1465
+ res->some.total_time.value_total = str2ull(procfile_lineword(ff, l, 8), NULL) / 1000; // us->ms
1466
+ did_some = true;
1467
+ }
1468
+ else if(strcmp(key, "full") == 0) {
1469
+ res->full.share_time.value10 = strtod(procfile_lineword(ff, l, 2), NULL);
1470
+ res->full.share_time.value60 = strtod(procfile_lineword(ff, l, 4), NULL);
1471
+ res->full.share_time.value300 = strtod(procfile_lineword(ff, l, 6), NULL);
1472
+ res->full.total_time.value_total = str2ull(procfile_lineword(ff, l, 8), NULL) / 1000; // us->ms
1473
+ did_full = true;
1474
+ }
1475
}
1476
1466
- res->updated = 1;
1477
+ res->updated = (did_full || did_some) ? 1 : 0;
1478
1468
- if (unlikely(res->some.enabled == CONFIG_BOOLEAN_AUTO)) {
1469
- res->some.enabled = CONFIG_BOOLEAN_YES;
1470
- if (lines > 2) {
1471
- res->full.enabled = CONFIG_BOOLEAN_YES;
1472
- } else {
1473
- res->full.enabled = CONFIG_BOOLEAN_NO;
1474
- }
1475
- }
1479
+ if(unlikely(res->some.enabled == CONFIG_BOOLEAN_AUTO))
1480
+ res->some.enabled = (did_some) ? CONFIG_BOOLEAN_YES : CONFIG_BOOLEAN_NO;
1481
+
1482
+ if(unlikely(res->full.enabled == CONFIG_BOOLEAN_AUTO))
1483
+ res->full.enabled = (did_full) ? CONFIG_BOOLEAN_YES : CONFIG_BOOLEAN_NO;
1484
}
1485
}
1486
@@ -1637,6 +1645,7 @@ static inline void read_cgroup(struct cgroup *cg) {
1645
cgroup2_read_pressure(&cg->cpu_pressure);
1646
cgroup2_read_pressure(&cg->io_pressure);
1647
cgroup2_read_pressure(&cg->memory_pressure);
1648
+ cgroup2_read_pressure(&cg->irq_pressure);
1649
cgroup_read_memory(&cg->memory, 1);
1650
}
1651
}
@@ -1851,6 +1860,7 @@ static inline void cgroup_free(struct cgroup *cg) {
1860
free_pressure(&cg->cpu_pressure);
1861
free_pressure(&cg->io_pressure);
1862
free_pressure(&cg->memory_pressure);
1863
+ free_pressure(&cg->irq_pressure);
1864
1865
freez(cg->id);
1866
freez(cg->intermediate_id);
@@ -2465,6 +2475,18 @@ static inline void discovery_update_filenames() {
2475
netdata_log_debug(D_CGROUP, "memory.pressure file for cgroup '%s': '%s' does not exist", cg->id, filename);
2476
}
2477
}
2478
+
2479
+ if (unlikely((cgroup_enable_pressure_irq_some || cgroup_enable_pressure_irq_full) && !cg->irq_pressure.filename)) {
2480
+ snprintfz(filename, FILENAME_MAX, "%s%s/irq.pressure", cgroup_unified_base, cg->id);
2481
+ if (likely(stat(filename, &buf) != -1)) {
2482
+ cg->irq_pressure.filename = strdupz(filename);
2483
+ cg->irq_pressure.some.enabled = cgroup_enable_pressure_irq_some;
2484
+ cg->irq_pressure.full.enabled = cgroup_enable_pressure_irq_full;
2485
+ netdata_log_debug(D_CGROUP, "irq.pressure filename for cgroup '%s': '%s'", cg->id, cg->irq_pressure.filename);
2486
+ } else {
2487
+ netdata_log_debug(D_CGROUP, "irq.pressure file for cgroup '%s': '%s' does not exist", cg->id, filename);
2488
+ }
2489
+ }
2490
}
2491
}
2492
}
@@ -4643,6 +4665,112 @@ void update_cgroup_charts(int update_every) {
4665
update_pressure_charts(pcs);
4666
}
4667
4668
+ res = &cg->irq_pressure;
4669
+
4670
+ if (likely(res->updated && res->some.enabled)) {
4671
+ struct pressure_charts *pcs;
4672
+ pcs = &res->some;
4673
+
4674
+ if (unlikely(!pcs->share_time.st)) {
4675
+ RRDSET *chart;
4676
+ snprintfz(title, CHART_TITLE_MAX, "IRQ some pressure");
4677
+ chart = pcs->share_time.st = rrdset_create_localhost(
4678
+ cgroup_chart_type(type, cg->chart_id, RRD_ID_LENGTH_MAX)
4679
+ , "irq_some_pressure"
4680
+ , NULL
4681
+ , "interrupts"
4682
+ , k8s_is_kubepod(cg) ? "k8s.cgroup.irq_some_pressure" : "cgroup.irq_some_pressure"
4683
+ , title
4684
+ , "percentage"
4685
+ , PLUGIN_CGROUPS_NAME
4686
+ , PLUGIN_CGROUPS_MODULE_CGROUPS_NAME
4687
+ , cgroup_containers_chart_priority + 2310
4688
+ , update_every
4689
+ , RRDSET_TYPE_LINE
4690
+ );
4691
+ rrdset_update_rrdlabels(chart = pcs->share_time.st, cg->chart_labels);
4692
+ pcs->share_time.rd10 = rrddim_add(chart, "some 10", NULL, 1, 100, RRD_ALGORITHM_ABSOLUTE);
4693
+ pcs->share_time.rd60 = rrddim_add(chart, "some 60", NULL, 1, 100, RRD_ALGORITHM_ABSOLUTE);
4694
+ pcs->share_time.rd300 = rrddim_add(chart, "some 300", NULL, 1, 100, RRD_ALGORITHM_ABSOLUTE);
4695
+ }
4696
+
4697
+ if (unlikely(!pcs->total_time.st)) {
4698
+ RRDSET *chart;
4699
+ snprintfz(title, CHART_TITLE_MAX, "IRQ some pressure stall time");
4700
+ chart = pcs->total_time.st = rrdset_create_localhost(
4701
+ cgroup_chart_type(type, cg->chart_id, RRD_ID_LENGTH_MAX)
4702
+ , "irq_some_pressure_stall_time"
4703
+ , NULL
4704
+ , "interrupts"
4705
+ , k8s_is_kubepod(cg) ? "k8s.cgroup.irq_some_pressure_stall_time" : "cgroup.irq_some_pressure_stall_time"
4706
+ , title
4707
+ , "ms"
4708
+ , PLUGIN_CGROUPS_NAME
4709
+ , PLUGIN_CGROUPS_MODULE_CGROUPS_NAME
4710
+ , cgroup_containers_chart_priority + 2330
4711
+ , update_every
4712
+ , RRDSET_TYPE_LINE
4713
+ );
4714
+ rrdset_update_rrdlabels(chart = pcs->total_time.st, cg->chart_labels);
4715
+ pcs->total_time.rdtotal = rrddim_add(chart, "time", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
4716
+ }
4717
+
4718
+ update_pressure_charts(pcs);
4719
+ }
4720
+
4721
+ if (likely(res->updated && res->full.enabled)) {
4722
+ struct pressure_charts *pcs;
4723
+ pcs = &res->full;
4724
+
4725
+ if (unlikely(!pcs->share_time.st)) {
4726
+ RRDSET *chart;
4727
+ snprintfz(title, CHART_TITLE_MAX, "IRQ full pressure");
4728
+
4729
+ chart = pcs->share_time.st = rrdset_create_localhost(
4730
+ cgroup_chart_type(type, cg->chart_id, RRD_ID_LENGTH_MAX)
4731
+ , "irq_full_pressure"
4732
+ , NULL
4733
+ , "interrupts"
4734
+ , k8s_is_kubepod(cg) ? "k8s.cgroup.irq_full_pressure" : "cgroup.irq_full_pressure"
4735
+ , title
4736
+ , "percentage"
4737
+ , PLUGIN_CGROUPS_NAME
4738
+ , PLUGIN_CGROUPS_MODULE_CGROUPS_NAME
4739
+ , cgroup_containers_chart_priority + 2350
4740
+ , update_every
4741
+ , RRDSET_TYPE_LINE
4742
+ );
4743
+
4744
+ rrdset_update_rrdlabels(chart = pcs->share_time.st, cg->chart_labels);
4745
+ pcs->share_time.rd10 = rrddim_add(chart, "full 10", NULL, 1, 100, RRD_ALGORITHM_ABSOLUTE);
4746
+ pcs->share_time.rd60 = rrddim_add(chart, "full 60", NULL, 1, 100, RRD_ALGORITHM_ABSOLUTE);
4747
+ pcs->share_time.rd300 = rrddim_add(chart, "full 300", NULL, 1, 100, RRD_ALGORITHM_ABSOLUTE);
4748
+ }
4749
+
4750
+ if (unlikely(!pcs->total_time.st)) {
4751
+ RRDSET *chart;
4752
+ snprintfz(title, CHART_TITLE_MAX, "IRQ full pressure stall time");
4753
+ chart = pcs->total_time.st = rrdset_create_localhost(
4754
+ cgroup_chart_type(type, cg->chart_id, RRD_ID_LENGTH_MAX)
4755
+ , "irq_full_pressure_stall_time"
4756
+ , NULL
4757
+ , "interrupts"
4758
+ , k8s_is_kubepod(cg) ? "k8s.cgroup.irq_full_pressure_stall_time" : "cgroup.irq_full_pressure_stall_time"
4759
+ , title
4760
+ , "ms"
4761
+ , PLUGIN_CGROUPS_NAME
4762
+ , PLUGIN_CGROUPS_MODULE_CGROUPS_NAME
4763
+ , cgroup_containers_chart_priority + 2370
4764
+ , update_every
4765
+ , RRDSET_TYPE_LINE
4766
+ );
4767
+ rrdset_update_rrdlabels(chart = pcs->total_time.st, cg->chart_labels);
4768
+ pcs->total_time.rdtotal = rrddim_add(chart, "time", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
4769
+ }
4770
+
4771
+ update_pressure_charts(pcs);
4772
+ }
4773
+
4774
res = &cg->io_pressure;
4775
4776
if (likely(res->updated && res->some.enabled)) {
collectors/debugfs.plugin/debugfs_zswap.c
+14
-14
@@ -38,7 +38,7 @@ static struct netdata_zswap_metric zswap_calculated_metrics[] = {
38
.charttype = RRDSET_TYPE_LINE,
39
.enabled = CONFIG_BOOLEAN_YES,
40
.chart_created = CONFIG_BOOLEAN_NO,
41
- .prio = NETDATA_CHART_PRIO_SYSTEM_ZSWAP_COMPRESS_RATIO,
41
+ .prio = NETDATA_CHART_PRIO_MEM_ZSWAP_COMPRESS_RATIO,
42
.divisor = 100,
43
.convertv = NULL,
44
.value = -1},
@@ -71,7 +71,7 @@ static struct netdata_zswap_metric zswap_independent_metrics[] = {
71
.charttype = RRDSET_TYPE_AREA,
72
.enabled = CONFIG_BOOLEAN_YES,
73
.chart_created = CONFIG_BOOLEAN_NO,
74
- .prio = NETDATA_CHART_PRIO_SYSTEM_ZSWAP_POOL_TOT_SIZE,
74
+ .prio = NETDATA_CHART_PRIO_MEM_ZSWAP_POOL_TOT_SIZE,
75
.divisor = 1,
76
.convertv = NULL,
77
.value = -1},
@@ -84,7 +84,7 @@ static struct netdata_zswap_metric zswap_independent_metrics[] = {
84
.charttype = RRDSET_TYPE_AREA,
85
.enabled = CONFIG_BOOLEAN_YES,
86
.chart_created = CONFIG_BOOLEAN_NO,
87
- .prio = NETDATA_CHART_PRIO_SYSTEM_ZSWAP_STORED_PAGE,
87
+ .prio = NETDATA_CHART_PRIO_MEM_ZSWAP_STORED_PAGE,
88
.divisor = 1,
89
.convertv = pages_to_bytes,
90
.value = -1},
@@ -97,7 +97,7 @@ static struct netdata_zswap_metric zswap_independent_metrics[] = {
97
.charttype = RRDSET_TYPE_LINE,
98
.enabled = CONFIG_BOOLEAN_YES,
99
.chart_created = CONFIG_BOOLEAN_NO,
100
- .prio = NETDATA_CHART_PRIO_SYSTEM_ZSWAP_POOL_LIM_HIT,
100
+ .prio = NETDATA_CHART_PRIO_MEM_ZSWAP_POOL_LIM_HIT,
101
.divisor = 1,
102
.convertv = NULL,
103
.value = -1},
@@ -110,7 +110,7 @@ static struct netdata_zswap_metric zswap_independent_metrics[] = {
110
.charttype = RRDSET_TYPE_AREA,
111
.enabled = CONFIG_BOOLEAN_YES,
112
.chart_created = CONFIG_BOOLEAN_NO,
113
- .prio = NETDATA_CHART_PRIO_SYSTEM_ZSWAP_WRT_BACK_PAGES,
113
+ .prio = NETDATA_CHART_PRIO_MEM_ZSWAP_WRT_BACK_PAGES,
114
.divisor = 1,
115
.convertv = pages_to_bytes,
116
.value = -1},
@@ -123,7 +123,7 @@ static struct netdata_zswap_metric zswap_independent_metrics[] = {
123
.charttype = RRDSET_TYPE_AREA,
124
.enabled = CONFIG_BOOLEAN_YES,
125
.chart_created = CONFIG_BOOLEAN_NO,
126
- .prio = NETDATA_CHART_PRIO_SYSTEM_ZSWAP_SAME_FILL_PAGE,
126
+ .prio = NETDATA_CHART_PRIO_MEM_ZSWAP_SAME_FILL_PAGE,
127
.divisor = 1,
128
.convertv = pages_to_bytes,
129
.value = -1},
@@ -136,7 +136,7 @@ static struct netdata_zswap_metric zswap_independent_metrics[] = {
136
.charttype = RRDSET_TYPE_LINE,
137
.enabled = CONFIG_BOOLEAN_YES,
138
.chart_created = CONFIG_BOOLEAN_NO,
139
- .prio = NETDATA_CHART_PRIO_SYSTEM_ZSWAP_DUPP_ENTRY,
139
+ .prio = NETDATA_CHART_PRIO_MEM_ZSWAP_DUPP_ENTRY,
140
.divisor = 1,
141
.convertv = NULL,
142
.value = -1},
@@ -175,7 +175,7 @@ static struct netdata_zswap_metric zswap_rejected_metrics[] = {
175
.charttype = RRDSET_TYPE_STACKED,
176
.enabled = CONFIG_BOOLEAN_YES,
177
.chart_created = CONFIG_BOOLEAN_NO,
178
- .prio = NETDATA_CHART_PRIO_SYSTEM_ZSWAP_REJECTS,
178
+ .prio = NETDATA_CHART_PRIO_MEM_ZSWAP_REJECTS,
179
.divisor = 1,
180
.convertv = NULL,
181
.value = -1},
@@ -188,7 +188,7 @@ static struct netdata_zswap_metric zswap_rejected_metrics[] = {
188
.charttype = RRDSET_TYPE_STACKED,
189
.enabled = CONFIG_BOOLEAN_YES,
190
.chart_created = CONFIG_BOOLEAN_NO,
191
- .prio = NETDATA_CHART_PRIO_SYSTEM_ZSWAP_REJECTS,
191
+ .prio = NETDATA_CHART_PRIO_MEM_ZSWAP_REJECTS,
192
.divisor = 1,
193
.convertv = NULL,
194
.value = -1},
@@ -201,7 +201,7 @@ static struct netdata_zswap_metric zswap_rejected_metrics[] = {
201
.charttype = RRDSET_TYPE_STACKED,
202
.enabled = CONFIG_BOOLEAN_YES,
203
.chart_created = CONFIG_BOOLEAN_NO,
204
- .prio = NETDATA_CHART_PRIO_SYSTEM_ZSWAP_REJECTS,
204
+ .prio = NETDATA_CHART_PRIO_MEM_ZSWAP_REJECTS,
205
.divisor = 1,
206
.convertv = NULL,
207
.value = -1},
@@ -214,7 +214,7 @@ static struct netdata_zswap_metric zswap_rejected_metrics[] = {
214
.charttype = RRDSET_TYPE_STACKED,
215
.enabled = CONFIG_BOOLEAN_YES,
216
.chart_created = CONFIG_BOOLEAN_NO,
217
- .prio = NETDATA_CHART_PRIO_SYSTEM_ZSWAP_REJECTS,
217
+ .prio = NETDATA_CHART_PRIO_MEM_ZSWAP_REJECTS,
218
.divisor = 1,
219
.convertv = NULL,
220
.value = -1},
@@ -227,7 +227,7 @@ static struct netdata_zswap_metric zswap_rejected_metrics[] = {
227
.charttype = RRDSET_TYPE_STACKED,
228
.enabled = CONFIG_BOOLEAN_YES,
229
.chart_created = CONFIG_BOOLEAN_NO,
230
- .prio = NETDATA_CHART_PRIO_SYSTEM_ZSWAP_REJECTS,
230
+ .prio = NETDATA_CHART_PRIO_MEM_ZSWAP_REJECTS,
231
.divisor = 1,
232
.convertv = NULL,
233
.value = -1},
@@ -266,7 +266,7 @@ zswap_send_chart(struct netdata_zswap_metric *metric, int update_every, const ch
266
{
267
fprintf(
268
stdout,
269
- "CHART system.zswap_%s '' '%s' '%s' 'zswap' '' '%s' %d %d '%s' 'debugfs.plugin' '%s'\n",
269
+ "CHART mem.zswap_%s '' '%s' '%s' 'zswap' '' '%s' %d %d '%s' 'debugfs.plugin' '%s'\n",
270
metric->chart_id,
271
metric->title,
272
metric->units,
@@ -291,7 +291,7 @@ static void zswap_send_dimension(struct netdata_zswap_metric *metric)
291
292
static void zswap_send_begin(struct netdata_zswap_metric *metric)
293
{
294
- fprintf(stdout, "BEGIN system.zswap_%s\n", metric->chart_id);
294
+ fprintf(stdout, "BEGIN mem.zswap_%s\n", metric->chart_id);
295
}
296
297
static void zswap_send_set(struct netdata_zswap_metric *metric)
collectors/ebpf.plugin/ebpf_swap.c
+4
-4
@@ -322,13 +322,13 @@ void ebpf_obsolete_swap_apps_charts(struct ebpf_module *em)
322
*/
323
static void ebpf_obsolete_swap_global(ebpf_module_t *em)
324
{
325
- ebpf_write_chart_obsolete(NETDATA_EBPF_SYSTEM_GROUP,
325
+ ebpf_write_chart_obsolete(NETDATA_EBPF_MEMORY_GROUP,
326
NETDATA_MEM_SWAP_CHART,
327
"Calls to access swap memory",
328
EBPF_COMMON_DIMENSION_CALL, NETDATA_SYSTEM_SWAP_SUBMENU,
329
NETDATA_EBPF_CHART_TYPE_LINE,
330
NULL,
331
- NETDATA_CHART_PRIO_SYSTEM_SWAP_CALLS,
331
+ NETDATA_CHART_PRIO_MEM_SWAP_CALLS,
332
em->update_every);
333
}
334
@@ -914,12 +914,12 @@ static void ebpf_swap_allocate_global_vectors(int apps)
914
*/
915
static void ebpf_create_swap_charts(int update_every)
916
{
917
- ebpf_create_chart(NETDATA_EBPF_SYSTEM_GROUP, NETDATA_MEM_SWAP_CHART,
917
+ ebpf_create_chart(NETDATA_EBPF_MEMORY_GROUP, NETDATA_MEM_SWAP_CHART,
918
"Calls to access swap memory",
919
EBPF_COMMON_DIMENSION_CALL, NETDATA_SYSTEM_SWAP_SUBMENU,
920
NULL,
921
NETDATA_EBPF_CHART_TYPE_LINE,
922
- NETDATA_CHART_PRIO_SYSTEM_SWAP_CALLS,
922
+ NETDATA_CHART_PRIO_MEM_SWAP_CALLS,
923
ebpf_create_global_dimension,
924
swap_publish_aggregated, NETDATA_SWAP_END,
925
update_every, NETDATA_EBPF_MODULE_NAME_SWAP);
collectors/freebsd.plugin/freebsd_sysctl.c
+2
-2
@@ -1035,7 +1035,7 @@ int do_vm_stats_sys_v_swappgs(int update_every, usec_t dt) {
1035
1036
if (unlikely(!st)) {
1037
st = rrdset_create_localhost(
1038
- "system",
1038
+ "mem",
1039
"swapio",
1040
NULL,
1041
"swap",
@@ -1044,7 +1044,7 @@ int do_vm_stats_sys_v_swappgs(int update_every, usec_t dt) {
1044
"KiB/s",
1045
"freebsd.plugin",
1046
"vm.stats.vm.v_swappgs",
1047
- NETDATA_CHART_PRIO_SYSTEM_SWAPIO,
1047
+ NETDATA_CHART_PRIO_MEM_SWAPIO,
1048
update_every,
1049
RRDSET_TYPE_AREA
1050
);
collectors/proc.plugin/multi_metadata.yaml
+375
-37
@@ -20,27 +20,50 @@ modules:
20
most_popular: false
21
overview:
22
data_collection:
23
- metrics_description: "This integration provides a collection of statistics about the system such as CPU utilization, process counts and more."
23
+ metrics_description: |
24
+ CPU utilization, states and frequencies and key Linux system performance metrics.
25
+
26
+ The `/proc/stat` file provides various types of system statistics:
27
+
28
+ - The overall system CPU usage statistics
29
+ - Per CPU core statistics
30
+ - The total context switching of the system
31
+ - The total number of processes running
32
+ - The total CPU interrupts
33
+ - The total CPU softirqs
34
+
35
+ The collector also reads:
36
+
37
+ - `/proc/schedstat` for statistics about the process scheduler in the Linux kernel.
38
+ - `/sys/devices/system/cpu/[X]/thermal_throttle/core_throttle_count` to get the count of thermal throttling events for a specific CPU core on Linux systems.
39
+ - `/sys/devices/system/cpu/[X]/thermal_throttle/package_throttle_count` to get the count of thermal throttling events for a specific CPU package on a Linux system.
40
+ - `/sys/devices/system/cpu/[X]/cpufreq/scaling_cur_freq` to get the current operating frequency of a specific CPU core.
41
+ - `/sys/devices/system/cpu/[X]/cpufreq/stats/time_in_state` to get the amount of time the CPU has spent in each of its available frequency states.
42
+ - `/sys/devices/system/cpu/[X]/cpuidle/state[X]/name` to get the names of the idle states for each CPU core in a Linux system.
43
+ - `/sys/devices/system/cpu/[X]/cpuidle/state[X]/time` to get the total time each specific CPU core has spent in each idle state since the system was started.
44
method_description: ""
45
supported_platforms:
26
- include: []
46
+ include: [ "linux" ]
47
exclude: []
28
- multi_instance: true
48
+ multi_instance: false
49
additional_permissions:
50
description: ""
51
default_behavior:
52
auto_detection:
33
- description: ""
53
+ description: |
54
+ The collector auto-detects all metrics. No configuration is needed.
55
limits:
56
description: ""
57
performance_impact:
37
- description: ""
58
+ description: |
59
+ The collector disables cpu frequency and idle state monitoring when there are more than 128 CPU cores available.
60
setup:
61
prerequisites:
62
list: []
63
configuration:
64
file:
43
- name: ""
65
+ section_name: "plugin:proc:/proc/stat"
66
+ name: "netdata.conf"
67
description: ""
68
options:
69
description: ""
@@ -187,12 +210,43 @@ modules:
210
most_popular: false
211
overview:
212
data_collection:
190
- metrics_description: ""
213
+ metrics_description: |
214
+ Entropy, a measure of the randomness or unpredictability of data.
215
+
216
+ In the context of cryptography, entropy is used to generate random numbers or keys that are essential for
217
+ secure communication and encryption. Without a good source of entropy, cryptographic protocols can become
218
+ vulnerable to attacks that exploit the predictability of the generated keys.
219
+
220
+ In most operating systems, entropy is generated by collecting random events from various sources, such as
221
+ hardware interrupts, mouse movements, keyboard presses, and disk activity. These events are fed into a pool
222
+ of entropy, which is then used to generate random numbers when needed.
223
+
224
+ The `/dev/random` device in Linux is one such source of entropy, and it provides an interface for programs
225
+ to access the pool of entropy. When a program requests random numbers, it reads from the `/dev/random` device,
226
+ which blocks until enough entropy is available to generate the requested numbers. This ensures that the
227
+ generated numbers are truly random and not predictable.
228
+
229
+ However, if the pool of entropy gets depleted, the `/dev/random` device may block indefinitely, causing
230
+ programs that rely on random numbers to slow down or even freeze. This is especially problematic for
231
+ cryptographic protocols that require a continuous stream of random numbers, such as SSL/TLS and SSH.
232
+
233
+ To avoid this issue, some systems use a hardware random number generator (RNG) to generate high-quality
234
+ entropy. A hardware RNG generates random numbers by measuring physical phenomena, such as thermal noise or
235
+ radioactive decay. These sources of randomness are considered to be more reliable and unpredictable than
236
+ software-based sources.
237
+
238
+ One such hardware RNG is the Trusted Platform Module (TPM), which is a dedicated hardware chip that is used
239
+ for cryptographic operations and secure boot. The TPM contains a built-in hardware RNG that generates
240
+ high-quality entropy, which can be used to seed the pool of entropy in the operating system.
241
+
242
+ Alternatively, software-based solutions such as `Haveged` can be used to generate additional entropy by
243
+ exploiting sources of randomness in the system, such as CPU utilization and network traffic. These solutions
244
+ can help to mitigate the risk of entropy depletion, but they may not be as reliable as hardware-based solutions.
245
method_description: ""
246
supported_platforms:
193
- include: []
247
+ include: [ "linux" ]
248
exclude: []
195
- multi_instance: true
249
+ multi_instance: false
250
additional_permissions:
251
description: ""
252
default_behavior:
@@ -264,12 +318,23 @@ modules:
318
most_popular: false
319
overview:
320
data_collection:
267
- metrics_description: "This integration provides the amount of time the system has been up (running)."
321
+ metrics_description: |
322
+ The amount of time the system has been up (running).
323
+
324
+ Uptime is a critical aspect of overall system performance:
325
+
326
+ - **Availability**: Uptime monitoring can show whether a server is consistently available or experiences frequent downtimes.
327
+ - **Performance Monitoring**: While server uptime alone doesn't provide detailed performance data, analyzing the duration and frequency of downtimes can help identify patterns or trends.
328
+ - **Proactive problem detection**: If server uptime monitoring reveals unexpected downtimes or a decreasing uptime trend, it can serve as an early warning sign of potential problems.
329
+ - **Root cause analysis**: When investigating server downtime, the uptime metric alone may not provide enough information to pinpoint the exact cause.
330
+ - **Load balancing**: Uptime data can indirectly indicate load balancing issues if certain servers have significantly lower uptimes than others.
331
+ - **Optimize maintenance efforts**: Servers with consistently low uptimes or frequent downtimes may require more attention.
332
+ - **Compliance requirements**: Server uptime data can be used to demonstrate compliance with regulatory requirements or SLAs that mandate a minimum level of server availability.
333
method_description: ""
334
supported_platforms:
270
- include: []
335
+ include: [ "linux" ]
336
exclude: []
272
- multi_instance: true
337
+ multi_instance: false
338
additional_permissions:
339
description: ""
340
default_behavior:
@@ -340,12 +405,33 @@ modules:
405
most_popular: false
406
overview:
407
data_collection:
343
- metrics_description: "This integration provides information about process, memory, swap space utilization and many more."
408
+ metrics_description: |
409
+ Linux Virtual memory subsystem.
410
+
411
+ Information about memory management, indicating how effectively the kernel allocates and frees
412
+ memory resources in response to system demands.
413
+
414
+ Monitors page faults, which occur when a process requests a portion of its memory that isn't
415
+ immediately available. Monitoring these events can help diagnose inefficiencies in memory management and
416
+ provide insights into application behavior.
417
+
418
+ Tracks swapping activity — a vital aspect of memory management where the kernel moves data from RAM to
419
+ swap space, and vice versa, based on memory demand and usage. It also monitors the utilization of zswap,
420
+ a compressed cache for swap pages, and provides insights into its usage and performance implications.
421
+
422
+ In the context of virtualized environments, it tracks the ballooning mechanism which is used to balance
423
+ memory resources between host and guest systems.
424
+
425
+ For systems using NUMA architecture, it provides insights into the local and remote memory accesses, which
426
+ can impact the performance based on the memory access times.
427
+
428
+ The collector also watches for 'Out of Memory' kills, a drastic measure taken by the system when it runs out
429
+ of memory resources.
430
method_description: ""
431
supported_platforms:
346
- include: []
432
+ include: [ "linux" ]
433
exclude: []
348
- multi_instance: true
434
+ multi_instance: false
435
additional_permissions:
436
description: ""
437
default_behavior:
@@ -535,7 +621,37 @@ modules:
621
most_popular: false
622
overview:
623
data_collection:
538
- metrics_description: "Monitor Interrupts metrics for efficient processor interrupt handling."
624
+ metrics_description: |
625
+ Monitors `/proc/interrupts`, a file organized by CPU and then by the type of interrupt.
626
+ The numbers reported are the counts of the interrupts that have occurred of each type.
627
+
628
+ An interrupt is a signal to the processor emitted by hardware or software indicating an event that needs
629
+ immediate attention. The processor then interrupts its current activities and executes the interrupt handler
630
+ to deal with the event. This is part of the way a computer multitasks and handles concurrent processing.
631
+
632
+ The types of interrupts include:
633
+
634
+ - **I/O interrupts**: These are caused by I/O devices like the keyboard, mouse, printer, etc. For example, when
635
+ you type something on the keyboard, an interrupt is triggered so the processor can handle the new input.
636
+
637
+ - **Timer interrupts**: These are generated at regular intervals by the system's timer circuit. It's primarily
638
+ used to switch the CPU among different tasks.
639
+
640
+ - **Software interrupts**: These are generated by a program requiring disk I/O operations, or other system resources.
641
+
642
+ - **Hardware interrupts**: These are caused by hardware conditions such as power failure, overheating, etc.
643
+
644
+ Monitoring `/proc/interrupts` can be used for:
645
+
646
+ - **Performance tuning**: If an interrupt is happening very frequently, it could be a sign that a device is not
647
+ configured correctly, or there is a software bug causing unnecessary interrupts. This could lead to system
648
+ performance degradation.
649
+
650
+ - **System troubleshooting**: If you're seeing a lot of unexpected interrupts, it could be a sign of a hardware problem.
651
+
652
+ - **Understanding system behavior**: More generally, keeping an eye on what interrupts are occurring can help you
653
+ understand what your system is doing. It can provide insights into the system's interaction with hardware,
654
+ drivers, and other parts of the kernel.
655
method_description: ""
656
supported_platforms:
657
include: []
@@ -621,12 +737,35 @@ modules:
737
most_popular: false
738
overview:
739
data_collection:
624
- metrics_description: "This integration provides the system load average for the last 1, 5, and 15 minutes."
740
+ metrics_description: |
741
+ The `/proc/loadavg` file provides information about the system load average.
742
+
743
+ The load average is a measure of the amount of computational work that a system performs. It is a
744
+ representation of the average system load over a period of time.
745
+
746
+ This file contains three numbers representing the system load averages for the last 1, 5, and 15 minutes,
747
+ respectively. It also includes the currently running processes and the total number of processes.
748
+
749
+ Monitoring the load average can be used for:
750
+
751
+ - **System performance**: If the load average is too high, it may indicate that your system is overloaded.
752
+ On a system with a single CPU, if the load average is 1, it means the single CPU is fully utilized. If the
753
+ load averages are consistently higher than the number of CPUs/cores, it may indicate that your system is
754
+ overloaded and tasks are waiting for CPU time.
755
+
756
+ - **Troubleshooting**: If the load average is unexpectedly high, it can be a sign of a problem. This could be
757
+ due to a runaway process, a software bug, or a hardware issue.
758
+
759
+ - **Capacity planning**: By monitoring the load average over time, you can understand the trends in your
760
+ system's workload. This can help with capacity planning and scaling decisions.
761
+
762
+ Remember that load average not only considers CPU usage, but also includes processes waiting for disk I/O.
763
+ Therefore, high load averages could be due to I/O contention as well as CPU contention.
764
method_description: ""
765
supported_platforms:
766
include: []
767
exclude: []
629
- multi_instance: true
768
+ multi_instance: false
769
additional_permissions:
770
description: ""
771
default_behavior:
@@ -726,12 +865,35 @@ modules:
865
most_popular: false
866
overview:
867
data_collection:
729
- metrics_description: "This integration measures system pressure, which can indicate resource shortages in CPU, memory, or I/O."
868
+ metrics_description: |
869
+ Introduced in Linux kernel 4.20, `/proc/pressure` provides information about system pressure stall information
870
+ (PSI). PSI is a feature that allows the system to track the amount of time the system is stalled due to
871
+ resource contention, such as CPU, memory, or I/O.
872
+
873
+ The collectors monitored 3 separate files for CPU, memory, and I/O:
874
+
875
+ - **cpu**: Tracks the amount of time tasks are stalled due to CPU contention.
876
+ - **memory**: Tracks the amount of time tasks are stalled due to memory contention.
877
+ - **io**: Tracks the amount of time tasks are stalled due to I/O contention.
878
+ - **irq**: Tracks the amount of time tasks are stalled due to IRQ contention.
879
+
880
+ Each of them provides metrics for stall time over the last 10 seconds, 1 minute, 5 minutes, and 15 minutes.
881
+
882
+ Monitoring the /proc/pressure files can provide important insights into system performance and capacity planning:
883
+
884
+ - **Identifying resource contention**: If these metrics are consistently high, it indicates that tasks are
885
+ frequently being stalled due to lack of resources, which can significantly degrade system performance.
886
+
887
+ - **Troubleshooting performance issues**: If a system is experiencing performance issues, these metrics can
888
+ help identify whether resource contention is the cause.
889
+
890
+ - **Capacity planning**: By monitoring these metrics over time, you can understand trends in resource
891
+ utilization and make informed decisions about when to add more resources to your system.
892
method_description: ""
893
supported_platforms:
894
include: []
895
exclude: []
734
- multi_instance: true
896
+ multi_instance: false
897
additional_permissions:
898
description: ""
899
default_behavior:
@@ -878,7 +1040,29 @@ modules:
1040
most_popular: false
1041
overview:
1042
data_collection:
881
- metrics_description: "Monitor SoftIRQs metrics for efficient software interrupt operations."
1043
+ metrics_description: |
1044
+ In the Linux kernel, handling of hardware interrupts is split into two halves: the top half and the bottom half.
1045
+ The top half is the routine that responds immediately to an interrupt, while the bottom half is deferred to be processed later.
1046
+
1047
+ Softirqs are a mechanism in the Linux kernel used to handle the bottom halves of interrupts, which can be
1048
+ deferred and processed later in a context where it's safe to enable interrupts.
1049
+
1050
+ The actual work of handling the interrupt is offloaded to a softirq and executed later when the system
1051
+ decides it's a good time to process them. This helps to keep the system responsive by not blocking the top
1052
+ half for too long, which could lead to missed interrupts.
1053
+
1054
+ Monitoring `/proc/softirqs` is useful for:
1055
+
1056
+ - **Performance tuning**: A high rate of softirqs could indicate a performance issue. For instance, a high
1057
+ rate of network softirqs (`NET_RX` and `NET_TX`) could indicate a network performance issue.
1058
+
1059
+ - **Troubleshooting**: If a system is behaving unexpectedly, checking the softirqs could provide clues about
1060
+ what is going on. For example, a sudden increase in block device softirqs (BLOCK) might indicate a problem
1061
+ with a disk.
1062
+
1063
+ - **Understanding system behavior**: Knowing what types of softirqs are happening can help you understand what
1064
+ your system is doing, particularly in terms of how it's interacting with hardware and how it's handling
1065
+ interrupts.
1066
method_description: ""
1067
supported_platforms:
1068
include: []
@@ -963,7 +1147,29 @@ modules:
1147
most_popular: false
1148
overview:
1149
data_collection:
966
- metrics_description: "This integration provides statistics on Softnet, such as processed events, dropped events and more."
1150
+ metrics_description: |
1151
+ `/proc/net/softnet_stat` provides statistics that relate to the handling of network packets by softirq.
1152
+
1153
+ It provides information about:
1154
+
1155
+ - Total number of processed packets (`processed`).
1156
+ - Times ksoftirq ran out of quota (`dropped`).
1157
+ - Times net_rx_action was rescheduled.
1158
+ - Number of times processed all lists before quota.
1159
+ - Number of times did not process all lists due to quota.
1160
+ - Number of times net_rx_action was rescheduled for GRO (Generic Receive Offload) cells.
1161
+ - Number of times GRO cells were processed.
1162
+
1163
+ Monitoring the /proc/net/softnet_stat file can be useful for:
1164
+
1165
+ - **Network performance monitoring**: By tracking the total number of processed packets and how many packets
1166
+ were dropped, you can gain insights into your system's network performance.
1167
+
1168
+ - **Troubleshooting**: If you're experiencing network-related issues, this collector can provide valuable clues.
1169
+ For instance, a high number of dropped packets may indicate a network problem.
1170
+
1171
+ - **Capacity planning**: If your system is consistently processing near its maximum capacity of network
1172
+ packets, it might be time to consider upgrading your network infrastructure.
1173
method_description: ""
1174
supported_platforms:
1175
include: []
@@ -1069,12 +1275,28 @@ modules:
1275
most_popular: false
1276
overview:
1277
data_collection:
1072
- metrics_description: "Monitor memory usage metrics for efficient system memory management."
1278
+ metrics_description: |
1279
+ `/proc/meminfo` provides detailed information about the system's current memory usage. It includes information
1280
+ about different types of memory, RAM, Swap, ZSwap, HugePages, Transparent HugePages (THP), Kernel memory,
1281
+ SLAB memory, memory mappings, and more.
1282
+
1283
+ Monitoring /proc/meminfo can be useful for:
1284
+
1285
+ - **Performance Tuning**: Understanding your system's memory usage can help you make decisions about system
1286
+ tuning and optimization. For example, if your system is frequently low on free memory, it might benefit
1287
+ from more RAM.
1288
+
1289
+ - **Troubleshooting**: If your system is experiencing problems, `/proc/meminfo` can provide clues about
1290
+ whether memory usage is a factor. For example, if your system is slow and cached swap is high, it could
1291
+ mean that your system is swapping out a lot of memory to disk, which can degrade performance.
1292
+
1293
+ - **Capacity Planning**: By monitoring memory usage over time, you can understand trends and make informed
1294
+ decisions about future capacity needs.
1295
method_description: ""
1296
supported_platforms:
1297
include: []
1298
exclude: []
1077
- multi_instance: true
1299
+ multi_instance: false
1300
additional_permissions:
1301
description: ""
1302
default_behavior:
@@ -1152,13 +1374,26 @@ modules:
1374
chart_type: area
1375
dimensions:
1376
- name: avail
1155
- - name: system.swap
1377
+ - name: mem.swap
1378
description: System Swap
1379
unit: "MiB"
1380
chart_type: stacked
1381
dimensions:
1382
- name: free
1383
- name: used
1384
+ - name: mem.swap_cached
1385
+ description: Swap Memory Cached in RAM
1386
+ unit: "MiB"
1387
+ chart_type: stacked
1388
+ dimensions:
1389
+ - name: cached
1390
+ - name: mem.zswap
1391
+ description: Zswap Usage
1392
+ unit: "MiB"
1393
+ chart_type: stacked
1394
+ dimensions:
1395
+ - name: in-ram
1396
+ - name: on-disk
1397
- name: mem.hwcorrupt
1398
description: Corrupted Memory detected by ECC
1399
unit: "MiB"
@@ -1198,7 +1433,7 @@ modules:
1433
dimensions:
1434
- name: reclaimable
1435
- name: unreclaimable
1201
- - name: mem.hugepage
1436
+ - name: mem.hugepages
1437
description: Dedicated HugePages Memory
1438
unit: "MiB"
1439
chart_type: stacked
@@ -1207,13 +1442,59 @@ modules:
1442
- name: used
1443
- name: surplus
1444
- name: reserved
1210
- - name: mem.transparent_hugepages
1445
+ - name: mem.thp
1446
description: Transparent HugePages Memory
1447
unit: "MiB"
1448
chart_type: stacked
1449
dimensions:
1450
- name: anonymous
1451
- name: shmem
1452
+ - name: mem.thp_details
1453
+ description: Details of Transparent HugePages Usage
1454
+ unit: "MiB"
1455
+ chart_type: line
1456
+ dimensions:
1457
+ - name: ShmemPmdMapped
1458
+ - name: FileHugePages
1459
+ - name: FilePmdMapped
1460
+ - name: mem.reclaiming
1461
+ description: Memory Reclaiming
1462
+ unit: "MiB"
1463
+ chart_type: line
1464
+ dimensions:
1465
+ - name: Active
1466
+ - name: Inactive
1467
+ - name: Active(anon)
1468
+ - name: Inactive(anon)
1469
+ - name: Active(file)
1470
+ - name: Inactive(file)
1471
+ - name: Unevictable
1472
+ - name: Mlocked
1473
+ - name: mem.high_low
1474
+ description: High and Low Used and Free Memory Areas
1475
+ unit: "MiB"
1476
+ chart_type: stacked
1477
+ dimensions:
1478
+ - name: high_used
1479
+ - name: low_used
1480
+ - name: high_free
1481
+ - name: low_free
1482
+ - name: mem.cma
1483
+ description: Contiguous Memory Allocator (CMA) Memory
1484
+ unit: "MiB"
1485
+ chart_type: stacked
1486
+ dimensions:
1487
+ - name: used
1488
+ - name: free
1489
+ - name: mem.directmaps
1490
+ description: Direct Memory Mappings
1491
+ unit: "MiB"
1492
+ chart_type: stacked
1493
+ dimensions:
1494
+ - name: 4k
1495
+ - name: 2m
1496
+ - name: 4m
1497
+ - name: 1g
1498
- meta:
1499
plugin_name: proc.plugin
1500
module_name: /proc/pagetypeinfo
@@ -1238,7 +1519,7 @@ modules:
1519
supported_platforms:
1520
include: []
1521
exclude: []
1241
- multi_instance: true
1522
+ multi_instance: false
1523
additional_permissions:
1524
description: ""
1525
default_behavior:
@@ -1326,7 +1607,20 @@ modules:
1607
most_popular: false
1608
overview:
1609
data_collection:
1329
- metrics_description: "This integration monitors system memory errors detected and corrected by ECC RAM."
1610
+ metrics_description: |
1611
+ The Error Detection and Correction (EDAC) subsystem is detecting and reporting errors in the system's memory,
1612
+ primarily ECC (Error-Correcting Code) memory errors.
1613
+
1614
+ The collector provides data for:
1615
+
1616
+ - Per memory controller (MC): correctable and uncorrectable errors. These can be of 2 kinds:
1617
+ - errors related to a DIMM
1618
+ - errors that cannot be associated with a DIMM
1619
+
1620
+ - Per memory DIMM: correctable and uncorrectable errors. There are 2 kinds:
1621
+ - memory controllers that can identify the physical DIMMS and report errors directly for them,
1622
+ - memory controllers that report errors for memory address ranges that can be linked to dimms.
1623
+ In this case the DIMMS reported may be more than the physical DIMMS installed.
1624
method_description: ""
1625
supported_platforms:
1626
include: []
@@ -1423,7 +1717,7 @@ modules:
1717
- name: dimm_location
1718
description: Location of the memory module.
1719
- name: dimm_mem_type
1426
- description: Type of the memory module. Usually either buffered or unbuffered memory.
1720
+ description: Type of the memory module.
1721
- name: size
1722
description: The amount of memory in megabytes that this memory module manages.
1723
metrics:
@@ -1453,7 +1747,19 @@ modules:
1747
most_popular: false
1748
overview:
1749
data_collection:
1456
- metrics_description: "Monitor NUMA metrics for efficient non-uniform memory access operations."
1750
+ metrics_description: |
1751
+ Information about NUMA (Non-Uniform Memory Access) nodes on the system.
1752
+
1753
+ NUMA is a method of configuring a cluster of microprocessor in a multiprocessing system so that they can
1754
+ share memory locally, improving performance and the ability of the system to be expanded. NUMA is used in a
1755
+ symmetric multiprocessing (SMP) system.
1756
+
1757
+ In a NUMA system, processors, memory, and I/O devices are grouped together into cells, also known as nodes.
1758
+ Each node has its own memory and set of I/O devices, and one or more processors. While a processor can access
1759
+ memory in any of the nodes, it does so faster when accessing memory within its own node.
1760
+
1761
+ The collector provides statistics on memory allocations for processes running on the NUMA nodes, revealing the
1762
+ efficiency of memory allocations in multi-node systems.
1763
method_description: ""
1764
supported_platforms:
1765
include: []
@@ -1530,15 +1836,23 @@ modules:
1836
description: ""
1837
keywords:
1838
- ksm
1839
+ - samepage
1840
+ - merging
1841
most_popular: false
1842
overview:
1843
data_collection:
1536
- metrics_description: "Examine KSM metrics for insights into memory deduplication operations."
1844
+ metrics_description: |
1845
+ Kernel Samepage Merging (KSM) is a memory-saving feature in Linux that enables the kernel to examine the
1846
+ memory of different processes and identify identical pages. It then merges these identical pages into a
1847
+ single page that the processes share. This is particularly useful for virtualization, where multiple virtual
1848
+ machines might be running the same operating system or applications and have many identical pages.
1849
+
1850
+ The collector provides information about the operation and effectiveness of KSM on your system.
1851
method_description: ""
1852
supported_platforms:
1853
include: []
1854
exclude: []
1541
- multi_instance: true
1855
+ multi_instance: false
1856
additional_permissions:
1857
description: ""
1858
default_behavior:
@@ -1622,7 +1936,11 @@ modules:
1936
most_popular: false
1937
overview:
1938
data_collection:
1625
- metrics_description: "This integration monitors ZRAM usage, compression ratios, and more."
1939
+ metrics_description: |
1940
+ zRAM, or compressed RAM, is a block device that uses a portion of your system's RAM as a block device.
1941
+ The data written to this block device is compressed and stored in memory.
1942
+
1943
+ The collectors provides information about the operation and the effectiveness of zRAM on your system.
1944
method_description: ""
1945
supported_platforms:
1946
include: []
@@ -1715,15 +2033,30 @@ modules:
2033
keywords:
2034
- ipc
2035
- semaphores
2036
+ - shared memory
2037
most_popular: false
2038
overview:
2039
data_collection:
1721
- metrics_description: "Monitor Inter Process Communication performance for optimal process interaction."
2040
+ metrics_description: |
2041
+ IPC stands for Inter-Process Communication. It is a mechanism which allows processes to communicate with each
2042
+ other and synchronize their actions.
2043
+
2044
+ This collector exposes information about:
2045
+
2046
+ - Message Queues: This allows messages to be exchanged between processes. It's a more flexible method that
2047
+ allows messages to be placed onto a queue and read at a later time.
2048
+
2049
+ - Shared Memory: This method allows for the fastest form of IPC because processes can exchange data by
2050
+ reading/writing into shared memory segments.
2051
+
2052
+ - Semaphores: They are used to synchronize the operations performed by independent processes. So, if multiple
2053
+ processes are trying to access a single shared resource, semaphores can ensure that only one process
2054
+ accesses the resource at a given time.
2055
method_description: ""
2056
supported_platforms:
2057
include: []
2058
exclude: []
1726
- multi_instance: true
2059
+ multi_instance: false
2060
additional_permissions:
2061
description: ""
2062
default_behavior:
@@ -1828,13 +2161,18 @@ modules:
2161
description: ""
2162
keywords:
2163
- disk
2164
+ - disks
2165
- io
2166
- bcache
2167
- block devices
2168
most_popular: false
2169
overview:
2170
data_collection:
1837
- metrics_description: "This integration provides statistics about disk and Bcache I/O."
2171
+ metrics_description: |
2172
+ Detailed statistics for each of your system's disk devices and partitions.
2173
+ The data is reported by the kernel and can be used to monitor disk activity on a Linux system.
2174
+
2175
+ Get valuable insight into how your disks are performing and where potential bottlenecks might be.
2176
method_description: ""
2177
supported_platforms:
2178
include: []
collectors/proc.plugin/proc_meminfo.c
+426
-94
@@ -9,58 +9,92 @@ int do_proc_meminfo(int update_every, usec_t dt) {
9
(void)dt;
10
11
static procfile *ff = NULL;
12
- static int do_ram = -1, do_swap = -1, do_hwcorrupt = -1, do_committed = -1, do_writeback = -1, do_kernel = -1, do_slab = -1, do_hugepages = -1, do_transparent_hugepages = -1;
13
- static int do_percpu = 0;
12
+ static int do_ram = -1
13
+ , do_swap = -1
14
+ , do_hwcorrupt = -1
15
+ , do_committed = -1
16
+ , do_writeback = -1
17
+ , do_kernel = -1
18
+ , do_slab = -1
19
+ , do_hugepages = -1
20
+ , do_transparent_hugepages = -1
21
+ , do_reclaiming = -1
22
+ , do_high_low = -1
23
+ , do_cma = -1
24
+ , do_directmap = -1;
25
26
static ARL_BASE *arl_base = NULL;
16
- static ARL_ENTRY *arl_hwcorrupted = NULL, *arl_memavailable = NULL;
27
+ static ARL_ENTRY *arl_hwcorrupted = NULL, *arl_memavailable = NULL, *arl_hugepages_total = NULL,
28
+ *arl_zswapped = NULL, *arl_high_low = NULL, *arl_cma_total = NULL,
29
+ *arl_directmap4k = NULL, *arl_directmap2m = NULL, *arl_directmap4m = NULL, *arl_directmap1g = NULL;
30
31
static unsigned long long
19
- MemTotal = 0,
20
- MemFree = 0,
21
- MemAvailable = 0,
22
- Buffers = 0,
23
- Cached = 0,
24
- //SwapCached = 0,
25
- //Active = 0,
26
- //Inactive = 0,
27
- //ActiveAnon = 0,
28
- //InactiveAnon = 0,
29
- //ActiveFile = 0,
30
- //InactiveFile = 0,
31
- //Unevictable = 0,
32
- //Mlocked = 0,
33
- SwapTotal = 0,
34
- SwapFree = 0,
35
- Dirty = 0,
36
- Writeback = 0,
37
- //AnonPages = 0,
38
- //Mapped = 0,
39
- Shmem = 0,
40
- Slab = 0,
41
- SReclaimable = 0,
42
- SUnreclaim = 0,
43
- KernelStack = 0,
44
- PageTables = 0,
45
- NFS_Unstable = 0,
46
- Bounce = 0,
47
- WritebackTmp = 0,
48
- //CommitLimit = 0,
49
- Committed_AS = 0,
50
- //VmallocTotal = 0,
51
- VmallocUsed = 0,
52
- //VmallocChunk = 0,
53
- Percpu = 0,
54
- AnonHugePages = 0,
55
- ShmemHugePages = 0,
56
- HugePages_Total = 0,
57
- HugePages_Free = 0,
58
- HugePages_Rsvd = 0,
59
- HugePages_Surp = 0,
60
- Hugepagesize = 0,
61
- //DirectMap4k = 0,
62
- //DirectMap2M = 0,
63
- HardwareCorrupted = 0;
32
+ MemTotal = 0
33
+ , MemFree = 0
34
+ , MemAvailable = 0
35
+ , Buffers = 0
36
+ , Cached = 0
37
+ , SwapCached = 0
38
+ , Active = 0
39
+ , Inactive = 0
40
+ , ActiveAnon = 0
41
+ , InactiveAnon = 0
42
+ , ActiveFile = 0
43
+ , InactiveFile = 0
44
+ , Unevictable = 0
45
+ , Mlocked = 0
46
+ , HighTotal = 0
47
+ , HighFree = 0
48
+ , LowTotal = 0
49
+ , LowFree = 0
50
+ , MmapCopy = 0
51
+ , SwapTotal = 0
52
+ , SwapFree = 0
53
+ , Zswap = 0
54
+ , Zswapped = 0
55
+ , Dirty = 0
56
+ , Writeback = 0
57
+ , AnonPages = 0
58
+ , Mapped = 0
59
+ , Shmem = 0
60
+ , KReclaimable = 0
61
+ , Slab = 0
62
+ , SReclaimable = 0
63
+ , SUnreclaim = 0
64
+ , KernelStack = 0
65
+ , ShadowCallStack = 0
66
+ , PageTables = 0
67
+ , SecPageTables = 0
68
+ , NFS_Unstable = 0
69
+ , Bounce = 0
70
+ , WritebackTmp = 0
71
+ , CommitLimit = 0
72
+ , Committed_AS = 0
73
+ , VmallocTotal = 0
74
+ , VmallocUsed = 0
75
+ , VmallocChunk = 0
76
+ , Percpu = 0
77
+ //, EarlyMemtestBad = 0
78
+ , HardwareCorrupted = 0
79
+ , AnonHugePages = 0
80
+ , ShmemHugePages = 0
81
+ , ShmemPmdMapped = 0
82
+ , FileHugePages = 0
83
+ , FilePmdMapped = 0
84
+ , CmaTotal = 0
85
+ , CmaFree = 0
86
+ //, Unaccepted = 0
87
+ , HugePages_Total = 0
88
+ , HugePages_Free = 0
89
+ , HugePages_Rsvd = 0
90
+ , HugePages_Surp = 0
91
+ , Hugepagesize = 0
92
+ //, Hugetlb = 0
93
+ , DirectMap4k = 0
94
+ , DirectMap2M = 0
95
+ , DirectMap4M = 0
96
+ , DirectMap1G = 0
97
+ ;
98
99
if(unlikely(!arl_base)) {
100
do_ram = config_get_boolean(CONFIG_SECTION_PLUGIN_PROC_MEMINFO, "system ram", 1);
@@ -72,6 +106,12 @@ int do_proc_meminfo(int update_every, usec_t dt) {
106
do_slab = config_get_boolean(CONFIG_SECTION_PLUGIN_PROC_MEMINFO, "slab memory", 1);
107
do_hugepages = config_get_boolean_ondemand(CONFIG_SECTION_PLUGIN_PROC_MEMINFO, "hugepages", CONFIG_BOOLEAN_AUTO);
108
do_transparent_hugepages = config_get_boolean_ondemand(CONFIG_SECTION_PLUGIN_PROC_MEMINFO, "transparent hugepages", CONFIG_BOOLEAN_AUTO);
109
+ do_reclaiming = config_get_boolean(CONFIG_SECTION_PLUGIN_PROC_MEMINFO, "memory reclaiming", CONFIG_BOOLEAN_AUTO);
110
+ do_high_low = config_get_boolean(CONFIG_SECTION_PLUGIN_PROC_MEMINFO, "high low memory", CONFIG_BOOLEAN_AUTO);
111
+ do_cma = config_get_boolean(CONFIG_SECTION_PLUGIN_PROC_MEMINFO, "cma memory", CONFIG_BOOLEAN_AUTO);
112
+ do_directmap = config_get_boolean(CONFIG_SECTION_PLUGIN_PROC_MEMINFO, "direct maps", CONFIG_BOOLEAN_AUTO);
113
+
114
+ // https://github.com/torvalds/linux/blob/master/fs/proc/meminfo.c
115
116
arl_base = arl_create("meminfo", NULL, 60);
117
arl_expect(arl_base, "MemTotal", &MemTotal);
@@ -79,46 +119,90 @@ int do_proc_meminfo(int update_every, usec_t dt) {
119
arl_memavailable = arl_expect(arl_base, "MemAvailable", &MemAvailable);
120
arl_expect(arl_base, "Buffers", &Buffers);
121
arl_expect(arl_base, "Cached", &Cached);
82
- //arl_expect(arl_base, "SwapCached", &SwapCached);
83
- //arl_expect(arl_base, "Active", &Active);
84
- //arl_expect(arl_base, "Inactive", &Inactive);
85
- //arl_expect(arl_base, "ActiveAnon", &ActiveAnon);
86
- //arl_expect(arl_base, "InactiveAnon", &InactiveAnon);
87
- //arl_expect(arl_base, "ActiveFile", &ActiveFile);
88
- //arl_expect(arl_base, "InactiveFile", &InactiveFile);
89
- //arl_expect(arl_base, "Unevictable", &Unevictable);
90
- //arl_expect(arl_base, "Mlocked", &Mlocked);
122
+ arl_expect(arl_base, "SwapCached", &SwapCached);
123
+ arl_expect(arl_base, "Active", &Active);
124
+ arl_expect(arl_base, "Inactive", &Inactive);
125
+ arl_expect(arl_base, "Active(anon)", &ActiveAnon);
126
+ arl_expect(arl_base, "Inactive(anon)", &InactiveAnon);
127
+ arl_expect(arl_base, "Active(file)", &ActiveFile);
128
+ arl_expect(arl_base, "Inactive(file)", &InactiveFile);
129
+ arl_expect(arl_base, "Unevictable", &Unevictable);
130
+ arl_expect(arl_base, "Mlocked", &Mlocked);
131
+
132
+ // CONFIG_HIGHMEM
133
+ arl_high_low = arl_expect(arl_base, "HighTotal", &HighTotal);
134
+ arl_expect(arl_base, "HighFree", &HighFree);
135
+ arl_expect(arl_base, "LowTotal", &LowTotal);
136
+ arl_expect(arl_base, "LowFree", &LowFree);
137
+
138
+ // CONFIG_MMU
139
+ arl_expect(arl_base, "MmapCopy", &MmapCopy);
140
+
141
arl_expect(arl_base, "SwapTotal", &SwapTotal);
142
arl_expect(arl_base, "SwapFree", &SwapFree);
143
+
144
+ // CONFIG_ZSWAP
145
+ arl_zswapped = arl_expect(arl_base, "Zswap", &Zswap);
146
+ arl_expect(arl_base, "Zswapped", &Zswapped);
147
+
148
arl_expect(arl_base, "Dirty", &Dirty);
149
arl_expect(arl_base, "Writeback", &Writeback);
95
- //arl_expect(arl_base, "AnonPages", &AnonPages);
96
- //arl_expect(arl_base, "Mapped", &Mapped);
150
+ arl_expect(arl_base, "AnonPages", &AnonPages);
151
+ arl_expect(arl_base, "Mapped", &Mapped);
152
arl_expect(arl_base, "Shmem", &Shmem);
153
+ arl_expect(arl_base, "KReclaimable", &KReclaimable);
154
arl_expect(arl_base, "Slab", &Slab);
155
arl_expect(arl_base, "SReclaimable", &SReclaimable);
156
arl_expect(arl_base, "SUnreclaim", &SUnreclaim);
157
arl_expect(arl_base, "KernelStack", &KernelStack);
158
+
159
+ // CONFIG_SHADOW_CALL_STACK
160
+ arl_expect(arl_base, "ShadowCallStack", &ShadowCallStack);
161
+
162
arl_expect(arl_base, "PageTables", &PageTables);
163
+ arl_expect(arl_base, "SecPageTables", &SecPageTables);
164
arl_expect(arl_base, "NFS_Unstable", &NFS_Unstable);
165
arl_expect(arl_base, "Bounce", &Bounce);
166
arl_expect(arl_base, "WritebackTmp", &WritebackTmp);
106
- //arl_expect(arl_base, "CommitLimit", &CommitLimit);
167
+ arl_expect(arl_base, "CommitLimit", &CommitLimit);
168
arl_expect(arl_base, "Committed_AS", &Committed_AS);
108
- //arl_expect(arl_base, "VmallocTotal", &VmallocTotal);
169
+ arl_expect(arl_base, "VmallocTotal", &VmallocTotal);
170
arl_expect(arl_base, "VmallocUsed", &VmallocUsed);
110
- //arl_expect(arl_base, "VmallocChunk", &VmallocChunk);
171
+ arl_expect(arl_base, "VmallocChunk", &VmallocChunk);
172
arl_expect(arl_base, "Percpu", &Percpu);
173
+
174
+ // CONFIG_MEMTEST
175
+ //arl_expect(arl_base, "EarlyMemtestBad", &EarlyMemtestBad);
176
+
177
+ // CONFIG_MEMORY_FAILURE
178
arl_hwcorrupted = arl_expect(arl_base, "HardwareCorrupted", &HardwareCorrupted);
179
+
180
+ // CONFIG_TRANSPARENT_HUGEPAGE
181
arl_expect(arl_base, "AnonHugePages", &AnonHugePages);
182
arl_expect(arl_base, "ShmemHugePages", &ShmemHugePages);
115
- arl_expect(arl_base, "HugePages_Total", &HugePages_Total);
183
+ arl_expect(arl_base, "ShmemPmdMapped", &ShmemPmdMapped);
184
+ arl_expect(arl_base, "FileHugePages", &FileHugePages);
185
+ arl_expect(arl_base, "FilePmdMapped", &FilePmdMapped);
186
+
187
+ // CONFIG_CMA
188
+ arl_cma_total = arl_expect(arl_base, "CmaTotal", &CmaTotal);
189
+ arl_expect(arl_base, "CmaFree", &CmaFree);
190
+
191
+ // CONFIG_UNACCEPTED_MEMORY
192
+ //arl_expect(arl_base, "Unaccepted", &Unaccepted);
193
+
194
+ // these appear only when hugepages are supported
195
+ arl_hugepages_total = arl_expect(arl_base, "HugePages_Total", &HugePages_Total);
196
arl_expect(arl_base, "HugePages_Free", &HugePages_Free);
197
arl_expect(arl_base, "HugePages_Rsvd", &HugePages_Rsvd);
198
arl_expect(arl_base, "HugePages_Surp", &HugePages_Surp);
199
arl_expect(arl_base, "Hugepagesize", &Hugepagesize);
120
- //arl_expect(arl_base, "DirectMap4k", &DirectMap4k);
121
- //arl_expect(arl_base, "DirectMap2M", &DirectMap2M);
200
+ //arl_expect(arl_base, "Hugetlb", &Hugetlb);
201
+
202
+ arl_directmap4k = arl_expect(arl_base, "DirectMap4k", &DirectMap4k);
203
+ arl_directmap2m = arl_expect(arl_base, "DirectMap2M", &DirectMap2M);
204
+ arl_directmap4m = arl_expect(arl_base, "DirectMap4M", &DirectMap4M);
205
+ arl_directmap1g = arl_expect(arl_base, "DirectMap1G", &DirectMap1G);
206
}
207
208
if(unlikely(!ff)) {
@@ -136,26 +220,17 @@ int do_proc_meminfo(int update_every, usec_t dt) {
220
size_t lines = procfile_lines(ff), l;
221
222
arl_begin(arl_base);
139
-
140
- static int first_ff_read = 1;
141
-
223
for(l = 0; l < lines ;l++) {
224
size_t words = procfile_linewords(ff, l);
225
if(unlikely(words < 2)) continue;
226
146
- if (first_ff_read && !strcmp(procfile_lineword(ff, l, 0), "Percpu"))
147
- do_percpu = 1;
148
-
227
if(unlikely(arl_check(arl_base,
228
procfile_lineword(ff, l, 0),
229
procfile_lineword(ff, l, 1)))) break;
230
}
231
154
- if (first_ff_read)
155
- first_ff_read = 0;
156
-
232
// http://calimeroteknik.free.fr/blag/?article20/really-used-memory-on-gnu-linux
158
- unsigned long long MemCached = Cached + SReclaimable - Shmem;
233
+ unsigned long long MemCached = Cached + SReclaimable + KReclaimable - Shmem;
234
unsigned long long MemUsed = MemTotal - MemFree - MemCached - Buffers;
235
// The Linux kernel doesn't report ZFS ARC usage as cache memory (the ARC is included in the total used system memory)
236
if (!inside_lxc_container) {
@@ -207,7 +282,7 @@ int do_proc_meminfo(int update_every, usec_t dt) {
282
"mem"
283
, "available"
284
, NULL
210
- , "system"
285
+ , "overview"
286
, NULL
287
, "Available RAM for applications"
288
, "MiB"
@@ -238,7 +313,7 @@ int do_proc_meminfo(int update_every, usec_t dt) {
313
314
if(unlikely(!st_system_swap)) {
315
st_system_swap = rrdset_create_localhost(
241
- "system"
316
+ "mem"
317
, "swap"
318
, NULL
319
, "swap"
@@ -247,7 +322,7 @@ int do_proc_meminfo(int update_every, usec_t dt) {
322
, "MiB"
323
, PLUGIN_PROC_NAME
324
, PLUGIN_PROC_MODULE_MEMINFO_NAME
250
- , NETDATA_CHART_PRIO_SYSTEM_SWAP
325
+ , NETDATA_CHART_PRIO_MEM_SWAP
326
, update_every
327
, RRDSET_TYPE_STACKED
328
);
@@ -261,6 +336,62 @@ int do_proc_meminfo(int update_every, usec_t dt) {
336
rrddim_set_by_pointer(st_system_swap, rd_used, SwapUsed);
337
rrddim_set_by_pointer(st_system_swap, rd_free, SwapFree);
338
rrdset_done(st_system_swap);
339
+
340
+ {
341
+ static RRDSET *st_mem_swap_cached = NULL;
342
+ static RRDDIM *rd_cached = NULL;
343
+
344
+ if (unlikely(!st_mem_swap_cached)) {
345
+ st_mem_swap_cached = rrdset_create_localhost(
346
+ "mem"
347
+ , "swap_cached"
348
+ , NULL
349
+ , "swap"
350
+ , NULL
351
+ , "Swap Memory Cached in RAM"
352
+ , "MiB"
353
+ , PLUGIN_PROC_NAME
354
+ , PLUGIN_PROC_MODULE_MEMINFO_NAME
355
+ , NETDATA_CHART_PRIO_MEM_SWAP + 1
356
+ , update_every
357
+ , RRDSET_TYPE_AREA
358
+ );
359
+
360
+ rd_cached = rrddim_add(st_mem_swap_cached, "cached", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
361
+ }
362
+
363
+ rrddim_set_by_pointer(st_mem_swap_cached, rd_cached, SwapCached);
364
+ rrdset_done(st_mem_swap_cached);
365
+ }
366
+
367
+ if(arl_zswapped->flags & ARL_ENTRY_FLAG_FOUND) {
368
+ static RRDSET *st_mem_zswap = NULL;
369
+ static RRDDIM *rd_zswap = NULL, *rd_zswapped = NULL;
370
+
371
+ if (unlikely(!st_mem_zswap)) {
372
+ st_mem_zswap = rrdset_create_localhost(
373
+ "mem"
374
+ , "zswap"
375
+ , NULL
376
+ , "zswap"
377
+ , NULL
378
+ , "Zswap Usage"
379
+ , "MiB"
380
+ , PLUGIN_PROC_NAME
381
+ , PLUGIN_PROC_MODULE_MEMINFO_NAME
382
+ , NETDATA_CHART_PRIO_MEM_ZSWAP
383
+ , update_every
384
+ , RRDSET_TYPE_STACKED
385
+ );
386
+
387
+ rd_zswap = rrddim_add(st_mem_zswap, "zswap", "in-ram", 1, 1024, RRD_ALGORITHM_ABSOLUTE);
388
+ rd_zswapped = rrddim_add(st_mem_zswap, "zswapped", "on-disk", 1, 1024, RRD_ALGORITHM_ABSOLUTE);
389
+ }
390
+
391
+ rrddim_set_by_pointer(st_mem_zswap, rd_zswap, Zswap);
392
+ rrddim_set_by_pointer(st_mem_zswap, rd_zswapped, Zswapped);
393
+ rrdset_done(st_mem_zswap);
394
+ }
395
}
396
397
if(arl_hwcorrupted->flags & ARL_ENTRY_FLAG_FOUND &&
@@ -306,7 +437,7 @@ int do_proc_meminfo(int update_every, usec_t dt) {
437
"mem"
438
, "committed"
439
, NULL
309
- , "system"
440
+ , "overview"
441
, NULL
442
, "Committed (Allocated) Memory"
443
, "MiB"
@@ -335,7 +466,7 @@ int do_proc_meminfo(int update_every, usec_t dt) {
466
"mem"
467
, "writeback"
468
, NULL
338
- , "kernel"
469
+ , "writeback"
470
, NULL
471
, "Writeback Memory"
472
, "MiB"
@@ -367,7 +498,7 @@ int do_proc_meminfo(int update_every, usec_t dt) {
498
if(do_kernel) {
499
static RRDSET *st_mem_kernel = NULL;
500
static RRDDIM *rd_slab = NULL, *rd_kernelstack = NULL, *rd_pagetables = NULL, *rd_vmallocused = NULL,
370
- *rd_percpu = NULL;
501
+ *rd_percpu = NULL, *rd_kreclaimable = NULL;
502
503
if(unlikely(!st_mem_kernel)) {
504
st_mem_kernel = rrdset_create_localhost(
@@ -391,16 +522,16 @@ int do_proc_meminfo(int update_every, usec_t dt) {
522
rd_kernelstack = rrddim_add(st_mem_kernel, "KernelStack", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
523
rd_pagetables = rrddim_add(st_mem_kernel, "PageTables", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
524
rd_vmallocused = rrddim_add(st_mem_kernel, "VmallocUsed", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
394
- if (do_percpu)
395
- rd_percpu = rrddim_add(st_mem_kernel, "Percpu", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
525
+ rd_percpu = rrddim_add(st_mem_kernel, "Percpu", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
526
+ rd_kreclaimable = rrddim_add(st_mem_kernel, "KReclaimable", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
527
}
528
398
- rrddim_set_by_pointer(st_mem_kernel, rd_slab, Slab);
399
- rrddim_set_by_pointer(st_mem_kernel, rd_kernelstack, KernelStack);
400
- rrddim_set_by_pointer(st_mem_kernel, rd_pagetables, PageTables);
401
- rrddim_set_by_pointer(st_mem_kernel, rd_vmallocused, VmallocUsed);
402
- if (do_percpu)
403
- rrddim_set_by_pointer(st_mem_kernel, rd_percpu, Percpu);
529
+ rrddim_set_by_pointer(st_mem_kernel, rd_slab, Slab);
530
+ rrddim_set_by_pointer(st_mem_kernel, rd_kernelstack, KernelStack);
531
+ rrddim_set_by_pointer(st_mem_kernel, rd_pagetables, PageTables);
532
+ rrddim_set_by_pointer(st_mem_kernel, rd_vmallocused, VmallocUsed);
533
+ rrddim_set_by_pointer(st_mem_kernel, rd_percpu, Percpu);
534
+ rrddim_set_by_pointer(st_mem_kernel, rd_kreclaimable, KReclaimable);
535
536
rrdset_done(st_mem_kernel);
537
}
@@ -436,9 +567,10 @@ int do_proc_meminfo(int update_every, usec_t dt) {
567
rrdset_done(st_mem_slab);
568
}
569
439
- if(do_hugepages == CONFIG_BOOLEAN_YES || (do_hugepages == CONFIG_BOOLEAN_AUTO &&
570
+ if(arl_hugepages_total->flags & ARL_ENTRY_FLAG_FOUND &&
571
+ (do_hugepages == CONFIG_BOOLEAN_YES || (do_hugepages == CONFIG_BOOLEAN_AUTO &&
572
((Hugepagesize && HugePages_Total) ||
441
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
573
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES)))) {
574
do_hugepages = CONFIG_BOOLEAN_YES;
575
576
static RRDSET *st_mem_hugepages = NULL;
@@ -455,7 +587,7 @@ int do_proc_meminfo(int update_every, usec_t dt) {
587
, "MiB"
588
, PLUGIN_PROC_NAME
589
, PLUGIN_PROC_MODULE_MEMINFO_NAME
458
- , NETDATA_CHART_PRIO_MEM_HUGEPAGES + 1
590
+ , NETDATA_CHART_PRIO_MEM_HUGEPAGES
591
, update_every
592
, RRDSET_TYPE_STACKED
593
);
@@ -487,7 +619,7 @@ int do_proc_meminfo(int update_every, usec_t dt) {
619
if(unlikely(!st_mem_transparent_hugepages)) {
620
st_mem_transparent_hugepages = rrdset_create_localhost(
621
"mem"
490
- , "transparent_hugepages"
622
+ , "thp"
623
, NULL
624
, "hugepages"
625
, NULL
@@ -495,7 +627,7 @@ int do_proc_meminfo(int update_every, usec_t dt) {
627
, "MiB"
628
, PLUGIN_PROC_NAME
629
, PLUGIN_PROC_MODULE_MEMINFO_NAME
498
- , NETDATA_CHART_PRIO_MEM_HUGEPAGES
630
+ , NETDATA_CHART_PRIO_MEM_HUGEPAGES + 1
631
, update_every
632
, RRDSET_TYPE_STACKED
633
);
@@ -509,6 +641,206 @@ int do_proc_meminfo(int update_every, usec_t dt) {
641
rrddim_set_by_pointer(st_mem_transparent_hugepages, rd_anonymous, AnonHugePages);
642
rrddim_set_by_pointer(st_mem_transparent_hugepages, rd_shared, ShmemHugePages);
643
rrdset_done(st_mem_transparent_hugepages);
644
+
645
+ {
646
+ static RRDSET *st_mem_thp_details = NULL;
647
+ static RRDDIM *rd_shmem_pmd_mapped = NULL, *rd_file_huge_pages = NULL, *rd_file_pmd_mapped = NULL;
648
+
649
+ if(unlikely(!st_mem_thp_details)) {
650
+ st_mem_thp_details = rrdset_create_localhost(
651
+ "mem"
652
+ , "thp_details"
653
+ , NULL
654
+ , "hugepages"
655
+ , NULL
656
+ , "Details of Transparent HugePages Usage"
657
+ , "MiB"
658
+ , PLUGIN_PROC_NAME
659
+ , PLUGIN_PROC_MODULE_MEMINFO_NAME
660
+ , NETDATA_CHART_PRIO_MEM_HUGEPAGES_DETAILS
661
+ , update_every
662
+ , RRDSET_TYPE_LINE
663
+ );
664
+
665
+ rrdset_flag_set(st_mem_thp_details, RRDSET_FLAG_DETAIL);
666
+
667
+ rd_shmem_pmd_mapped = rrddim_add(st_mem_thp_details, "shmem_pmd", "ShmemPmdMapped", 1, 1024, RRD_ALGORITHM_ABSOLUTE);
668
+ rd_file_huge_pages = rrddim_add(st_mem_thp_details, "file", "FileHugePages", 1, 1024, RRD_ALGORITHM_ABSOLUTE);
669
+ rd_file_pmd_mapped = rrddim_add(st_mem_thp_details, "file_pmd", "FilePmdMapped", 1, 1024, RRD_ALGORITHM_ABSOLUTE);
670
+ }
671
+
672
+ rrddim_set_by_pointer(st_mem_thp_details, rd_shmem_pmd_mapped, ShmemPmdMapped);
673
+ rrddim_set_by_pointer(st_mem_thp_details, rd_file_huge_pages, FileHugePages);
674
+ rrddim_set_by_pointer(st_mem_thp_details, rd_file_pmd_mapped, FilePmdMapped);
675
+ rrdset_done(st_mem_thp_details);
676
+ }
677
+ }
678
+
679
+ if(do_reclaiming != CONFIG_BOOLEAN_NO) {
680
+ static RRDSET *st_mem_reclaiming = NULL;
681
+ static RRDDIM *rd_active = NULL, *rd_inactive = NULL,
682
+ *rd_active_anon = NULL, *rd_inactive_anon = NULL,
683
+ *rd_active_file = NULL, *rd_inactive_file = NULL,
684
+ *rd_unevictable = NULL, *rd_mlocked = NULL;
685
+
686
+ if(unlikely(!st_mem_reclaiming)) {
687
+ st_mem_reclaiming = rrdset_create_localhost(
688
+ "mem"
689
+ , "reclaiming"
690
+ , NULL
691
+ , "reclaiming"
692
+ , NULL
693
+ , "Memory Reclaiming"
694
+ , "MiB"
695
+ , PLUGIN_PROC_NAME
696
+ , PLUGIN_PROC_MODULE_MEMINFO_NAME
697
+ , NETDATA_CHART_PRIO_MEM_RECLAIMING
698
+ , update_every
699
+ , RRDSET_TYPE_LINE
700
+ );
701
+
702
+ rrdset_flag_set(st_mem_reclaiming, RRDSET_FLAG_DETAIL);
703
+
704
+ rd_active = rrddim_add(st_mem_reclaiming, "active", "Active", 1, 1024, RRD_ALGORITHM_ABSOLUTE);
705
+ rd_inactive = rrddim_add(st_mem_reclaiming, "inactive", "Inactive", 1, 1024, RRD_ALGORITHM_ABSOLUTE);
706
+ rd_active_anon = rrddim_add(st_mem_reclaiming, "active_anon", "Active(anon)", 1, 1024, RRD_ALGORITHM_ABSOLUTE);
707
+ rd_inactive_anon = rrddim_add(st_mem_reclaiming, "inactive_anon", "Inactive(anon)", 1, 1024, RRD_ALGORITHM_ABSOLUTE);
708
+ rd_active_file = rrddim_add(st_mem_reclaiming, "active_file", "Active(file)", 1, 1024, RRD_ALGORITHM_ABSOLUTE);
709
+ rd_inactive_file = rrddim_add(st_mem_reclaiming, "inactive_file", "Inactive(file)", 1, 1024, RRD_ALGORITHM_ABSOLUTE);
710
+ rd_unevictable = rrddim_add(st_mem_reclaiming, "unevictable", "Unevictable", 1, 1024, RRD_ALGORITHM_ABSOLUTE);
711
+ rd_mlocked = rrddim_add(st_mem_reclaiming, "mlocked", "Mlocked", 1, 1024, RRD_ALGORITHM_ABSOLUTE);
712
+ }
713
+
714
+ rrddim_set_by_pointer(st_mem_reclaiming, rd_active, Active);
715
+ rrddim_set_by_pointer(st_mem_reclaiming, rd_inactive, Inactive);
716
+ rrddim_set_by_pointer(st_mem_reclaiming, rd_active_anon, ActiveAnon);
717
+ rrddim_set_by_pointer(st_mem_reclaiming, rd_inactive_anon, InactiveAnon);
718
+ rrddim_set_by_pointer(st_mem_reclaiming, rd_active_file, ActiveFile);
719
+ rrddim_set_by_pointer(st_mem_reclaiming, rd_inactive_file, InactiveFile);
720
+ rrddim_set_by_pointer(st_mem_reclaiming, rd_unevictable, Unevictable);
721
+ rrddim_set_by_pointer(st_mem_reclaiming, rd_mlocked, Mlocked);
722
+
723
+ rrdset_done(st_mem_reclaiming);
724
+ }
725
+
726
+ if(do_high_low != CONFIG_BOOLEAN_NO && (arl_high_low->flags & ARL_ENTRY_FLAG_FOUND)) {
727
+ static RRDSET *st_mem_high_low = NULL;
728
+ static RRDDIM *rd_high_used = NULL, *rd_low_used = NULL;
729
+ static RRDDIM *rd_high_free = NULL, *rd_low_free = NULL;
730
+
731
+ if(unlikely(!st_mem_high_low)) {
732
+ st_mem_high_low = rrdset_create_localhost(
733
+ "mem"
734
+ , "high_low"
735
+ , NULL
736
+ , "high_low"
737
+ , NULL
738
+ , "High and Low Used and Free Memory Areas"
739
+ , "MiB"
740
+ , PLUGIN_PROC_NAME
741
+ , PLUGIN_PROC_MODULE_MEMINFO_NAME
742
+ , NETDATA_CHART_PRIO_MEM_HIGH_LOW
743
+ , update_every
744
+ , RRDSET_TYPE_STACKED
745
+ );
746
+
747
+ rrdset_flag_set(st_mem_high_low, RRDSET_FLAG_DETAIL);
748
+
749
+ rd_high_used = rrddim_add(st_mem_high_low, "high_used", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
750
+ rd_low_used = rrddim_add(st_mem_high_low, "low_used", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
751
+ rd_high_free = rrddim_add(st_mem_high_low, "high_free", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
752
+ rd_low_free = rrddim_add(st_mem_high_low, "low_free", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
753
+ }
754
+
755
+ rrddim_set_by_pointer(st_mem_high_low, rd_high_used, HighTotal - HighFree);
756
+ rrddim_set_by_pointer(st_mem_high_low, rd_low_used, LowTotal - LowFree);
757
+ rrddim_set_by_pointer(st_mem_high_low, rd_high_free, HighFree);
758
+ rrddim_set_by_pointer(st_mem_high_low, rd_low_free, LowFree);
759
+ rrdset_done(st_mem_high_low);
760
+ }
761
+
762
+ if(do_cma == CONFIG_BOOLEAN_YES || (do_cma == CONFIG_BOOLEAN_AUTO && (arl_cma_total->flags & ARL_ENTRY_FLAG_FOUND) && CmaTotal)) {
763
+ do_cma = CONFIG_BOOLEAN_YES;
764
+
765
+ static RRDSET *st_mem_cma = NULL;
766
+ static RRDDIM *rd_used = NULL, *rd_free = NULL;
767
+
768
+ if(unlikely(!st_mem_cma)) {
769
+ st_mem_cma = rrdset_create_localhost(
770
+ "mem"
771
+ , "cma"
772
+ , NULL
773
+ , "cma"
774
+ , NULL
775
+ , "Contiguous Memory Allocator (CMA) Memory"
776
+ , "MiB"
777
+ , PLUGIN_PROC_NAME
778
+ , PLUGIN_PROC_MODULE_MEMINFO_NAME
779
+ , NETDATA_CHART_PRIO_MEM_CMA
780
+ , update_every
781
+ , RRDSET_TYPE_STACKED
782
+ );
783
+
784
+ rd_used = rrddim_add(st_mem_cma, "used", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
785
+ rd_free = rrddim_add(st_mem_cma, "free", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
786
+ }
787
+
788
+ rrddim_set_by_pointer(st_mem_cma, rd_used, CmaTotal - CmaFree);
789
+ rrddim_set_by_pointer(st_mem_cma, rd_free, CmaFree);
790
+ rrdset_done(st_mem_cma);
791
+ }
792
+
793
+ if(do_directmap != CONFIG_BOOLEAN_NO &&
794
+ ((arl_directmap4k->flags & ARL_ENTRY_FLAG_FOUND) ||
795
+ (arl_directmap2m->flags & ARL_ENTRY_FLAG_FOUND) ||
796
+ (arl_directmap4m->flags & ARL_ENTRY_FLAG_FOUND) ||
797
+ (arl_directmap1g->flags & ARL_ENTRY_FLAG_FOUND)))
798
+ {
799
+ static RRDSET *st_mem_directmap = NULL;
800
+ static RRDDIM *rd_4k = NULL, *rd_2m = NULL, *rd_1g = NULL, *rd_4m = NULL;
801
+
802
+ if(unlikely(!st_mem_directmap)) {
803
+ st_mem_directmap = rrdset_create_localhost(
804
+ "mem"
805
+ , "directmaps"
806
+ , NULL
807
+ , "overview"
808
+ , NULL
809
+ , "Direct Memory Mappings"
810
+ , "MiB"
811
+ , PLUGIN_PROC_NAME
812
+ , PLUGIN_PROC_MODULE_MEMINFO_NAME
813
+ , NETDATA_CHART_PRIO_MEM_DIRECTMAP
814
+ , update_every
815
+ , RRDSET_TYPE_STACKED
816
+ );
817
+
818
+ if(arl_directmap4k->flags & ARL_ENTRY_FLAG_FOUND)
819
+ rd_4k = rrddim_add(st_mem_directmap, "4k", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
820
+
821
+ if(arl_directmap2m->flags & ARL_ENTRY_FLAG_FOUND)
822
+ rd_2m = rrddim_add(st_mem_directmap, "2m", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
823
+
824
+ if(arl_directmap4m->flags & ARL_ENTRY_FLAG_FOUND)
825
+ rd_4m = rrddim_add(st_mem_directmap, "4m", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
826
+
827
+ if(arl_directmap1g->flags & ARL_ENTRY_FLAG_FOUND)
828
+ rd_1g = rrddim_add(st_mem_directmap, "1g", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
829
+ }
830
+
831
+ if(rd_4k)
832
+ rrddim_set_by_pointer(st_mem_directmap, rd_4k, DirectMap4k);
833
+
834
+ if(rd_2m)
835
+ rrddim_set_by_pointer(st_mem_directmap, rd_2m, DirectMap2M);
836
+
837
+ if(rd_4m)
838
+ rrddim_set_by_pointer(st_mem_directmap, rd_4m, DirectMap4M);
839
+
840
+ if(rd_1g)
841
+ rrddim_set_by_pointer(st_mem_directmap, rd_1g, DirectMap1G);
842
+
843
+ rrdset_done(st_mem_directmap);
844
}
845
846
return 0;
collectors/proc.plugin/proc_pressure.c
+84
-53
@@ -12,28 +12,55 @@ static int pressure_update_every = 0;
12
13
static struct pressure resources[PRESSURE_NUM_RESOURCES] = {
14
{
15
- .some =
16
- {.share_time = {.id = "cpu_some_pressure", .title = "CPU some pressure"},
17
- .total_time = {.id = "cpu_some_pressure_stall_time", .title = "CPU some pressure stall time"}},
18
- .full =
19
- {.share_time = {.id = "cpu_full_pressure", .title = "CPU full pressure"},
20
- .total_time = {.id = "cpu_full_pressure_stall_time", .title = "CPU full pressure stall time"}},
15
+ .some = {
16
+ .available = true,
17
+ .share_time = {.id = "cpu_some_pressure", .title = "CPU some pressure"},
18
+ .total_time = {.id = "cpu_some_pressure_stall_time", .title = "CPU some pressure stall time"}
19
+ },
20
+ .full = {
21
+ // Disable CPU full pressure.
22
+ // See https://github.com/torvalds/linux/commit/890d550d7dbac7a31ecaa78732aa22be282bb6b8
23
+ .available = false,
24
+ .share_time = {.id = "cpu_full_pressure", .title = "CPU full pressure"},
25
+ .total_time = {.id = "cpu_full_pressure_stall_time", .title = "CPU full pressure stall time"}
26
+ },
27
},
28
{
23
- .some =
24
- {.share_time = {.id = "memory_some_pressure", .title = "Memory some pressure"},
25
- .total_time = {.id = "memory_some_pressure_stall_time", .title = "Memory some pressure stall time"}},
26
- .full =
27
- {.share_time = {.id = "memory_full_pressure", .title = "Memory full pressure"},
28
- .total_time = {.id = "memory_full_pressure_stall_time", .title = "Memory full pressure stall time"}},
29
+ .some = {
30
+ .available = true,
31
+ .share_time = {.id = "memory_some_pressure", .title = "Memory some pressure"},
32
+ .total_time = {.id = "memory_some_pressure_stall_time", .title = "Memory some pressure stall time"}
33
+ },
34
+ .full = {
35
+ .available = true,
36
+ .share_time = {.id = "memory_full_pressure", .title = "Memory full pressure"},
37
+ .total_time = {.id = "memory_full_pressure_stall_time", .title = "Memory full pressure stall time"}
38
+ },
39
},
40
{
31
- .some =
32
- {.share_time = {.id = "io_some_pressure", .title = "I/O some pressure"},
33
- .total_time = {.id = "io_some_pressure_stall_time", .title = "I/O some pressure stall time"}},
34
- .full =
35
- {.share_time = {.id = "io_full_pressure", .title = "I/O full pressure"},
36
- .total_time = {.id = "io_full_pressure_stall_time", .title = "I/O full pressure stall time"}},
41
+ .some = {
42
+ .available = true,
43
+ .share_time = {.id = "io_some_pressure", .title = "I/O some pressure"},
44
+ .total_time = {.id = "io_some_pressure_stall_time", .title = "I/O some pressure stall time"}
45
+ },
46
+ .full = {
47
+ .available = true,
48
+ .share_time = {.id = "io_full_pressure", .title = "I/O full pressure"},
49
+ .total_time = {.id = "io_full_pressure_stall_time", .title = "I/O full pressure stall time"}
50
+ },
51
+ },
52
+ {
53
+ .some = {
54
+ // this is not available
55
+ .available = false,
56
+ .share_time = {.id = "irq_some_pressure", .title = "IRQ some pressure"},
57
+ .total_time = {.id = "irq_some_pressure_stall_time", .title = "IRQ some pressure stall time"}
58
+ },
59
+ .full = {
60
+ .available = true,
61
+ .share_time = {.id = "irq_full_pressure", .title = "IRQ full pressure"},
62
+ .total_time = {.id = "irq_full_pressure_stall_time", .title = "IRQ full pressure stall time"}
63
+ },
64
},
65
};
66
@@ -46,6 +73,7 @@ static struct resource_info {
73
{ .name = "cpu", .family = "cpu", .section_priority = NETDATA_CHART_PRIO_SYSTEM_CPU },
74
{ .name = "memory", .family = "ram", .section_priority = NETDATA_CHART_PRIO_SYSTEM_RAM },
75
{ .name = "io", .family = "disk", .section_priority = NETDATA_CHART_PRIO_SYSTEM_IO },
76
+ { .name = "irq", .family = "interrupts", .section_priority = NETDATA_CHART_PRIO_SYSTEM_INTERRUPTS },
77
};
78
79
void update_pressure_charts(struct pressure_charts *pcs) {
@@ -65,7 +93,7 @@ void update_pressure_charts(struct pressure_charts *pcs) {
93
}
94
}
95
68
-static void proc_pressure_do_resource(procfile *ff, int res_idx, int some) {
96
+static void proc_pressure_do_resource(procfile *ff, int res_idx, size_t line, bool some) {
97
struct pressure_charts *pcs;
98
struct resource_info ri;
99
pcs = some ? &resources[res_idx].some : &resources[res_idx].full;
@@ -93,9 +121,9 @@ static void proc_pressure_do_resource(procfile *ff, int res_idx, int some) {
121
rrddim_add(pcs->share_time.st, some ? "some 300" : "full 300", NULL, 1, 100, RRD_ALGORITHM_ABSOLUTE);
122
}
123
96
- pcs->share_time.value10 = strtod(procfile_lineword(ff, some ? 0 : 1, 2), NULL);
97
- pcs->share_time.value60 = strtod(procfile_lineword(ff, some ? 0 : 1, 4), NULL);
98
- pcs->share_time.value300 = strtod(procfile_lineword(ff, some ? 0 : 1, 6), NULL);
124
+ pcs->share_time.value10 = strtod(procfile_lineword(ff, line, 2), NULL);
125
+ pcs->share_time.value60 = strtod(procfile_lineword(ff, line, 4), NULL);
126
+ pcs->share_time.value300 = strtod(procfile_lineword(ff, line, 6), NULL);
127
128
if (unlikely(!pcs->total_time.st)) {
129
pcs->total_time.st = rrdset_create_localhost(
@@ -114,19 +142,19 @@ static void proc_pressure_do_resource(procfile *ff, int res_idx, int some) {
142
pcs->total_time.rdtotal = rrddim_add(pcs->total_time.st, "time", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
143
}
144
117
- pcs->total_time.value_total = str2ull(procfile_lineword(ff, some ? 0 : 1, 8), NULL) / 1000;
145
+ pcs->total_time.value_total = str2ull(procfile_lineword(ff, line, 8), NULL) / 1000;
146
}
147
120
-static void proc_pressure_do_resource_some(procfile *ff, int res_idx) {
121
- proc_pressure_do_resource(ff, res_idx, 1);
148
+static void proc_pressure_do_resource_some(procfile *ff, int res_idx, size_t line) {
149
+ proc_pressure_do_resource(ff, res_idx, line, true);
150
}
151
124
-static void proc_pressure_do_resource_full(procfile *ff, int res_idx) {
125
- proc_pressure_do_resource(ff, res_idx, 0);
152
+static void proc_pressure_do_resource_full(procfile *ff, int res_idx, size_t line) {
153
+ proc_pressure_do_resource(ff, res_idx, line, false);
154
}
155
156
int do_proc_pressure(int update_every, usec_t dt) {
129
- int fail_count = 0;
157
+ int ok_count = 0;
158
int i;
159
160
static usec_t next_pressure_dt = 0;
@@ -161,56 +189,59 @@ int do_proc_pressure(int update_every, usec_t dt) {
189
, base_path
190
, resource_info[i].name);
191
192
+ do_some = resources[i].some.available ? CONFIG_BOOLEAN_YES : CONFIG_BOOLEAN_NO;
193
+ do_full = resources[i].full.available ? CONFIG_BOOLEAN_YES : CONFIG_BOOLEAN_NO;
194
+
195
snprintfz(config_key, CONFIG_MAX_NAME, "enable %s some pressure", resource_info[i].name);
165
- do_some = config_get_boolean(CONFIG_SECTION_PLUGIN_PROC_PRESSURE, config_key, CONFIG_BOOLEAN_YES);
196
+ do_some = config_get_boolean(CONFIG_SECTION_PLUGIN_PROC_PRESSURE, config_key, do_some);
197
resources[i].some.enabled = do_some;
198
168
- // Disable CPU full pressure.
169
- // See https://github.com/torvalds/linux/commit/890d550d7dbac7a31ecaa78732aa22be282bb6b8
170
- if (i == 0) {
171
- do_full = CONFIG_BOOLEAN_NO;
172
- resources[i].full.enabled = do_full;
173
- } else {
174
- snprintfz(config_key, CONFIG_MAX_NAME, "enable %s full pressure", resource_info[i].name);
175
- do_full = config_get_boolean(CONFIG_SECTION_PLUGIN_PROC_PRESSURE, config_key, CONFIG_BOOLEAN_YES);
176
- resources[i].full.enabled = do_full;
177
- }
199
+ snprintfz(config_key, CONFIG_MAX_NAME, "enable %s full pressure", resource_info[i].name);
200
+ do_full = config_get_boolean(CONFIG_SECTION_PLUGIN_PROC_PRESSURE, config_key, do_full);
201
+ resources[i].full.enabled = do_full;
202
+
203
+ if(!do_full && !do_some)
204
+ continue;
205
206
ff = procfile_open(filename, " =", PROCFILE_FLAG_DEFAULT);
207
if (unlikely(!ff)) {
208
collector_error("Cannot read pressure information from %s.", filename);
182
- fail_count++;
209
continue;
210
}
211
}
212
213
ff = procfile_readall(ff);
214
resource_info[i].pf = ff;
189
- if (unlikely(!ff)) {
190
- fail_count++;
215
+ if (unlikely(!ff))
216
continue;
192
- }
217
218
size_t lines = procfile_lines(ff);
219
if (unlikely(lines < 1)) {
220
collector_error("%s has no lines.", procfile_filename(ff));
197
- fail_count++;
221
continue;
222
}
223
201
- if (do_some) {
202
- proc_pressure_do_resource_some(ff, i);
203
- update_pressure_charts(&resources[i].some);
204
- }
205
- if (do_full && lines > 2) {
206
- proc_pressure_do_resource_full(ff, i);
207
- update_pressure_charts(&resources[i].full);
224
+ for(size_t l = 0; l < lines ;l++) {
225
+ const char *key = procfile_lineword(ff, l, 0);
226
+ if(strcmp(key, "some") == 0) {
227
+ if(do_some) {
228
+ proc_pressure_do_resource_some(ff, i, l);
229
+ update_pressure_charts(&resources[i].some);
230
+ ok_count++;
231
+ }
232
+ }
233
+ else if(strcmp(key, "full") == 0) {
234
+ if(do_full) {
235
+ proc_pressure_do_resource_full(ff, i, l);
236
+ update_pressure_charts(&resources[i].full);
237
+ ok_count++;
238
+ }
239
+ }
240
}
241
}
242
211
- if (PRESSURE_NUM_RESOURCES == fail_count) {
243
+ if(!ok_count)
244
return 1;
213
- }
245
246
return 0;
247
}
collectors/proc.plugin/proc_pressure.h
+2
-1
@@ -3,13 +3,14 @@
3
#ifndef NETDATA_PROC_PRESSURE_H
4
#define NETDATA_PROC_PRESSURE_H
5
6
-#define PRESSURE_NUM_RESOURCES 3
6
+#define PRESSURE_NUM_RESOURCES 4
7
8
struct pressure {
9
int updated;
10
char *filename;
11
12
struct pressure_charts {
13
+ bool available;
14
int enabled;
15
16
struct pressure_share_time_chart {
collectors/proc.plugin/proc_stat.c
+1
-1
@@ -494,7 +494,7 @@ int do_proc_stat(int update_every, usec_t dt) {
494
do_processes = config_get_boolean("plugin:proc:/proc/stat", "processes running", CONFIG_BOOLEAN_YES);
495
496
// give sane defaults based on the number of processors
497
- if(unlikely(get_system_cpus() > 50)) {
497
+ if(unlikely(get_system_cpus() > 128)) {
498
// the system has too many processors
499
keep_per_core_fds_open = CONFIG_BOOLEAN_NO;
500
do_core_throttle_count = CONFIG_BOOLEAN_NO;
collectors/proc.plugin/proc_vmstat.c
+6
-6
@@ -271,7 +271,7 @@ int do_proc_vmstat(int update_every, usec_t dt) {
271
272
if(unlikely(!st_swapio)) {
273
st_swapio = rrdset_create_localhost(
274
- "system"
274
+ "mem"
275
, "swapio"
276
, NULL
277
, "swap"
@@ -280,7 +280,7 @@ int do_proc_vmstat(int update_every, usec_t dt) {
280
, "KiB/s"
281
, PLUGIN_PROC_NAME
282
, PLUGIN_PROC_MODULE_VMSTAT_NAME
283
- , NETDATA_CHART_PRIO_SYSTEM_SWAPIO
283
+ , NETDATA_CHART_PRIO_MEM_SWAPIO
284
, update_every
285
, RRDSET_TYPE_AREA
286
);
@@ -336,7 +336,7 @@ int do_proc_vmstat(int update_every, usec_t dt) {
336
"mem"
337
, "pgfaults"
338
, NULL
339
- , "system"
339
+ , "page faults"
340
, NULL
341
, "Memory Page Faults"
342
, "faults/s"
@@ -372,7 +372,7 @@ int do_proc_vmstat(int update_every, usec_t dt) {
372
"mem"
373
, "oom_kill"
374
, NULL
375
- , "system"
375
+ , "OOM kills"
376
, NULL
377
, "Out of Memory Kills"
378
, "kills/s"
@@ -505,7 +505,7 @@ int do_proc_vmstat(int update_every, usec_t dt) {
505
506
if(unlikely(!st_zswapio)) {
507
st_zswapio = rrdset_create_localhost(
508
- "system"
508
+ "mem"
509
, "zswapio"
510
, NULL
511
, "zswap"
@@ -514,7 +514,7 @@ int do_proc_vmstat(int update_every, usec_t dt) {
514
, "KiB/s"
515
, PLUGIN_PROC_NAME
516
, PLUGIN_PROC_MODULE_VMSTAT_NAME
517
- , NETDATA_CHART_PRIO_SYSTEM_ZSWAPIO
517
+ , NETDATA_CHART_PRIO_MEM_ZSWAPIO
518
, update_every
519
, RRDSET_TYPE_AREA
520
);
health/health.d/swap.conf
+2
-2
@@ -2,7 +2,7 @@
2
# you can disable an alarm notification by setting the 'to' line to: silent
3
4
alarm: 30min_ram_swapped_out
5
- on: system.swapio
5
+ on: mem.swapio
6
class: Workload
7
type: System
8
component: Memory
@@ -19,7 +19,7 @@ component: Memory
19
to: sysadmin
20
21
alarm: used_swap
22
- on: system.swap
22
+ on: mem.swap
23
class: Utilization
24
type: System
25
component: Memory