eliminated unecessary chart lookups
Costa Tsaousis (ktsaou) committed
Oct 14, 2017 at 21:35 UTC
fc2bae4cd3fd98e2dedc2a34f89d56237a4087f6
11 files changed
+833
-780
src/freebsd_sysctl.c
+688
-636
@@ -133,18 +133,19 @@ int do_vm_loadavg(int update_every, usec_t dt){
133
static RRDDIM *rd_load1 = NULL, *rd_load2 = NULL, *rd_load3 = NULL;
134
135
if (unlikely(!st)) {
136
- st = rrdset_create_localhost("system",
137
- "load",
138
- NULL,
139
- "load",
140
- NULL,
141
- "System Load Average",
142
- "load",
143
- "freebsd",
144
- "vm.loadavg",
145
- 100,
146
- (update_every < MIN_LOADAVG_UPDATE_EVERY) ?
147
- MIN_LOADAVG_UPDATE_EVERY : update_every, RRDSET_TYPE_LINE
136
+ st = rrdset_create_localhost(
137
+ "system",
138
+ "load",
139
+ NULL,
140
+ "load",
141
+ NULL,
142
+ "System Load Average",
143
+ "load",
144
+ "freebsd",
145
+ "vm.loadavg",
146
+ 100,
147
+ (update_every < MIN_LOADAVG_UPDATE_EVERY) ?
148
+ MIN_LOADAVG_UPDATE_EVERY : update_every, RRDSET_TYPE_LINE
149
);
150
rd_load1 = rrddim_add(st, "load1", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
151
rd_load2 = rrddim_add(st, "load5", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
@@ -201,18 +202,19 @@ int do_vm_vmtotal(int update_every, usec_t dt) {
202
static RRDDIM *rd = NULL;
203
204
if (unlikely(!st)) {
204
- st = rrdset_create_localhost("system",
205
- "active_processes",
206
- NULL,
207
- "processes",
208
- NULL,
209
- "System Active Processes",
210
- "processes",
211
- "freebsd",
212
- "vm.vmtotal",
213
- 750,
214
- update_every,
215
- RRDSET_TYPE_LINE
205
+ st = rrdset_create_localhost(
206
+ "system",
207
+ "active_processes",
208
+ NULL,
209
+ "processes",
210
+ NULL,
211
+ "System Active Processes",
212
+ "processes",
213
+ "freebsd",
214
+ "vm.vmtotal",
215
+ 750,
216
+ update_every,
217
+ RRDSET_TYPE_LINE
218
);
219
rd = rrddim_add(st, "active", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
220
}
@@ -229,18 +231,19 @@ int do_vm_vmtotal(int update_every, usec_t dt) {
231
static RRDDIM *rd_running = NULL, *rd_blocked = NULL;
232
233
if (unlikely(!st)) {
232
- st = rrdset_create_localhost("system",
233
- "processes",
234
- NULL,
235
- "processes",
236
- NULL,
237
- "System Processes",
238
- "processes",
239
- "freebsd",
240
- "vm.vmtotal",
241
- 600,
242
- update_every,
243
- RRDSET_TYPE_LINE
234
+ st = rrdset_create_localhost(
235
+ "system",
236
+ "processes",
237
+ NULL,
238
+ "processes",
239
+ NULL,
240
+ "System Processes",
241
+ "processes",
242
+ "freebsd",
243
+ "vm.vmtotal",
244
+ 600,
245
+ update_every,
246
+ RRDSET_TYPE_LINE
247
);
248
249
rd_running = rrddim_add(st, "running", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
@@ -260,18 +263,19 @@ int do_vm_vmtotal(int update_every, usec_t dt) {
263
static RRDDIM *rd = NULL;
264
265
if (unlikely(!st)) {
263
- st = rrdset_create_localhost("mem",
264
- "committed",
265
- NULL,
266
- "system",
267
- NULL,
268
- "Committed (Allocated) Memory",
269
- "MB",
270
- "freebsd",
271
- "vm.vmtotal",
272
- 5000,
273
- update_every,
274
- RRDSET_TYPE_AREA
266
+ st = rrdset_create_localhost(
267
+ "mem",
268
+ "committed",
269
+ NULL,
270
+ "system",
271
+ NULL,
272
+ "Committed (Allocated) Memory",
273
+ "MB",
274
+ "freebsd",
275
+ "vm.vmtotal",
276
+ 5000,
277
+ update_every,
278
+ RRDSET_TYPE_AREA
279
);
280
rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
281
@@ -318,17 +322,18 @@ int do_kern_cp_time(int update_every, usec_t dt) {
322
static RRDDIM *rd_nice = NULL, *rd_system = NULL, *rd_user = NULL, *rd_interrupt = NULL, *rd_idle = NULL;
323
324
if (unlikely(!st)) {
321
- st = rrdset_create_localhost("system",
322
- "cpu",
323
- NULL,
324
- "cpu",
325
- "system.cpu",
326
- "Total CPU utilization",
327
- "percentage",
328
- "freebsd",
329
- "kern.cp_time",
330
- 100, update_every,
331
- RRDSET_TYPE_STACKED
325
+ st = rrdset_create_localhost(
326
+ "system",
327
+ "cpu",
328
+ NULL,
329
+ "cpu",
330
+ "system.cpu",
331
+ "Total CPU utilization",
332
+ "percentage",
333
+ "freebsd",
334
+ "kern.cp_time",
335
+ 100, update_every,
336
+ RRDSET_TYPE_STACKED
337
);
338
339
rd_nice = rrddim_add(st, "nice", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL);
@@ -398,18 +403,19 @@ int do_kern_cp_times(int update_every, usec_t dt) {
403
for (i = 0; i < number_of_cpus; i++) {
404
if (unlikely(!all_cpu_charts[i].st)) {
405
snprintfz(all_cpu_charts[i].cpuid, MAX_INT_DIGITS, "cpu%d", i);
401
- all_cpu_charts[i].st = rrdset_create_localhost("cpu",
402
- all_cpu_charts[i].cpuid,
403
- NULL,
404
- "utilization",
405
- "cpu.cpu",
406
- "Core utilization",
407
- "percentage",
408
- "freebsd",
409
- "kern.cp_times",
410
- 1000,
411
- update_every,
412
- RRDSET_TYPE_STACKED
406
+ all_cpu_charts[i].st = rrdset_create_localhost(
407
+ "cpu",
408
+ all_cpu_charts[i].cpuid,
409
+ NULL,
410
+ "utilization",
411
+ "cpu.cpu",
412
+ "Core utilization",
413
+ "percentage",
414
+ "freebsd",
415
+ "kern.cp_times",
416
+ 1000,
417
+ update_every,
418
+ RRDSET_TYPE_STACKED
419
);
420
421
all_cpu_charts[i].rd_nice = rrddim_add(all_cpu_charts[i].st, "nice", NULL, 1, 1,
@@ -481,18 +487,19 @@ int do_dev_cpu_temperature(int update_every, usec_t dt) {
487
}
488
489
if (unlikely(!st)) {
484
- st = rrdset_create_localhost("cpu",
485
- "temperature",
486
- NULL,
487
- "temperature",
488
- "cpu.temperatute",
489
- "Core temperature",
490
- "Celsius",
491
- "freebsd",
492
- "dev.cpu.temperature",
493
- 1050,
494
- update_every,
495
- RRDSET_TYPE_LINE
490
+ st = rrdset_create_localhost(
491
+ "cpu",
492
+ "temperature",
493
+ NULL,
494
+ "temperature",
495
+ "cpu.temperatute",
496
+ "Core temperature",
497
+ "Celsius",
498
+ "freebsd",
499
+ "dev.cpu.temperature",
500
+ 1050,
501
+ update_every,
502
+ RRDSET_TYPE_LINE
503
);
504
}
505
else rrdset_next(st);
@@ -533,18 +540,19 @@ int do_dev_cpu_0_freq(int update_every, usec_t dt) {
540
static RRDDIM *rd = NULL;
541
542
if (unlikely(!st)) {
536
- st = rrdset_create_localhost("cpu",
537
- "scaling_cur_freq",
538
- NULL,
539
- "cpufreq",
540
- NULL,
541
- "Current CPU Scaling Frequency",
542
- "MHz",
543
- "freebsd",
544
- "dev.cpu.0.freq",
545
- 5003,
546
- update_every,
547
- RRDSET_TYPE_LINE
543
+ st = rrdset_create_localhost(
544
+ "cpu",
545
+ "scaling_cur_freq",
546
+ NULL,
547
+ "cpufreq",
548
+ NULL,
549
+ "Current CPU Scaling Frequency",
550
+ "MHz",
551
+ "freebsd",
552
+ "dev.cpu.0.freq",
553
+ 5003,
554
+ update_every,
555
+ RRDSET_TYPE_LINE
556
);
557
558
rd = rrddim_add(st, "frequency", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
@@ -596,18 +604,19 @@ int do_hw_intcnt(int update_every, usec_t dt) {
604
static RRDDIM *rd_intr = NULL;
605
606
if (unlikely(!st_intr)) {
599
- st_intr = rrdset_create_localhost("system",
600
- "intr",
601
- NULL,
602
- "interrupts",
603
- NULL,
604
- "Total Hardware Interrupts",
605
- "interrupts/s",
606
- "freebsd",
607
- "hw.intrcnt",
608
- 900,
609
- update_every,
610
- RRDSET_TYPE_LINE
607
+ st_intr = rrdset_create_localhost(
608
+ "system",
609
+ "intr",
610
+ NULL,
611
+ "interrupts",
612
+ NULL,
613
+ "Total Hardware Interrupts",
614
+ "interrupts/s",
615
+ "freebsd",
616
+ "hw.intrcnt",
617
+ 900,
618
+ update_every,
619
+ RRDSET_TYPE_LINE
620
);
621
rrdset_flag_set(st_intr, RRDSET_FLAG_DETAIL);
622
@@ -641,18 +650,19 @@ int do_hw_intcnt(int update_every, usec_t dt) {
650
void *p;
651
652
if (unlikely(!st_interrupts))
644
- st_interrupts = rrdset_create_localhost("system",
645
- "interrupts",
646
- NULL,
647
- "interrupts",
648
- NULL,
649
- "System interrupts",
650
- "interrupts/s",
651
- "freebsd",
652
- "hw.intrcnt",
653
- 1000,
654
- update_every,
655
- RRDSET_TYPE_STACKED
653
+ st_interrupts = rrdset_create_localhost(
654
+ "system",
655
+ "interrupts",
656
+ NULL,
657
+ "interrupts",
658
+ NULL,
659
+ "System interrupts",
660
+ "interrupts/s",
661
+ "freebsd",
662
+ "hw.intrcnt",
663
+ 1000,
664
+ update_every,
665
+ RRDSET_TYPE_STACKED
666
);
667
else
668
rrdset_next(st_interrupts);
@@ -696,18 +706,19 @@ int do_vm_stats_sys_v_intr(int update_every, usec_t dt) {
706
static RRDDIM *rd = NULL;
707
708
if (unlikely(!st)) {
699
- st = rrdset_create_localhost("system",
700
- "dev_intr",
701
- NULL,
702
- "interrupts",
703
- NULL,
704
- "Device Interrupts",
705
- "interrupts/s",
706
- "freebsd",
707
- "vm.stats.sys.v_intr",
708
- 1000,
709
- update_every,
710
- RRDSET_TYPE_LINE
709
+ st = rrdset_create_localhost(
710
+ "system",
711
+ "dev_intr",
712
+ NULL,
713
+ "interrupts",
714
+ NULL,
715
+ "Device Interrupts",
716
+ "interrupts/s",
717
+ "freebsd",
718
+ "vm.stats.sys.v_intr",
719
+ 1000,
720
+ update_every,
721
+ RRDSET_TYPE_LINE
722
);
723
724
rd = rrddim_add(st, "interrupts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -741,18 +752,19 @@ int do_vm_stats_sys_v_soft(int update_every, usec_t dt) {
752
static RRDDIM *rd = NULL;
753
754
if (unlikely(!st)) {
744
- st = rrdset_create_localhost("system",
745
- "soft_intr",
746
- NULL,
747
- "interrupts",
748
- NULL,
749
- "Software Interrupts",
750
- "interrupts/s",
751
- "freebsd",
752
- "vm.stats.sys.v_soft",
753
- 1100,
754
- update_every,
755
- RRDSET_TYPE_LINE
755
+ st = rrdset_create_localhost(
756
+ "system",
757
+ "soft_intr",
758
+ NULL,
759
+ "interrupts",
760
+ NULL,
761
+ "Software Interrupts",
762
+ "interrupts/s",
763
+ "freebsd",
764
+ "vm.stats.sys.v_soft",
765
+ 1100,
766
+ update_every,
767
+ RRDSET_TYPE_LINE
768
);
769
770
rd = rrddim_add(st, "interrupts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -786,18 +798,19 @@ int do_vm_stats_sys_v_swtch(int update_every, usec_t dt) {
798
static RRDDIM *rd = NULL;
799
800
if (unlikely(!st)) {
789
- st = rrdset_create_localhost("system",
790
- "ctxt",
791
- NULL,
792
- "processes",
793
- NULL,
794
- "CPU Context Switches",
795
- "context switches/s",
796
- "freebsd",
797
- "vm.stats.sys.v_swtch",
798
- 800,
799
- update_every,
800
- RRDSET_TYPE_LINE
801
+ st = rrdset_create_localhost(
802
+ "system",
803
+ "ctxt",
804
+ NULL,
805
+ "processes",
806
+ NULL,
807
+ "CPU Context Switches",
808
+ "context switches/s",
809
+ "freebsd",
810
+ "vm.stats.sys.v_swtch",
811
+ 800,
812
+ update_every,
813
+ RRDSET_TYPE_LINE
814
);
815
816
rd = rrddim_add(st, "switches", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -831,18 +844,19 @@ int do_vm_stats_sys_v_forks(int update_every, usec_t dt) {
844
static RRDDIM *rd = NULL;
845
846
if (unlikely(!st)) {
834
- st = rrdset_create_localhost("system",
835
- "forks",
836
- NULL,
837
- "processes",
838
- NULL,
839
- "Started Processes",
840
- "processes/s",
841
- "freebsd",
842
- "vm.stats.sys.v_swtch",
843
- 700,
844
- update_every,
845
- RRDSET_TYPE_LINE
847
+ st = rrdset_create_localhost(
848
+ "system",
849
+ "forks",
850
+ NULL,
851
+ "processes",
852
+ NULL,
853
+ "Started Processes",
854
+ "processes/s",
855
+ "freebsd",
856
+ "vm.stats.sys.v_swtch",
857
+ 700,
858
+ update_every,
859
+ RRDSET_TYPE_LINE
860
);
861
862
rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
@@ -907,18 +921,19 @@ int do_vm_swap_info(int update_every, usec_t dt) {
921
static RRDDIM *rd_free = NULL, *rd_used = NULL;
922
923
if (unlikely(!st)) {
910
- st = rrdset_create_localhost("system",
911
- "swap",
912
- NULL,
913
- "swap",
914
- NULL,
915
- "System Swap",
916
- "MB",
917
- "freebsd",
918
- "vm.swap_info",
919
- 201,
920
- update_every,
921
- RRDSET_TYPE_STACKED
924
+ st = rrdset_create_localhost(
925
+ "system",
926
+ "swap",
927
+ NULL,
928
+ "swap",
929
+ NULL,
930
+ "System Swap",
931
+ "MB",
932
+ "freebsd",
933
+ "vm.swap_info",
934
+ 201,
935
+ update_every,
936
+ RRDSET_TYPE_STACKED
937
);
938
939
rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
@@ -955,7 +970,7 @@ int do_system_ram(int update_every, usec_t dt) {
970
GETSYSCTL_SIMPLE("vfs.bufspace", mib_vfs_bufspace, vfs_bufspace_count) ||
971
GETSYSCTL_SIMPLE("vm.stats.vm.v_free_count", mib_free_count, vmmeter_data.v_free_count))) {
972
error("DISABLED: system.ram chart");
958
- error("DISABLED: System.ram module");
973
+ error("DISABLED: system.ram module");
974
return 1;
975
} else {
976
@@ -965,20 +980,20 @@ int do_system_ram(int update_every, usec_t dt) {
980
static RRDDIM *rd_free = NULL, *rd_active = NULL, *rd_inactive = NULL,
981
*rd_wired = NULL, *rd_cache = NULL, *rd_buffers = NULL;
982
968
- st = rrdset_find_localhost("system.ram");
983
if (unlikely(!st)) {
970
- st = rrdset_create_localhost("system",
971
- "ram",
972
- NULL,
973
- "ram",
974
- NULL,
975
- "System RAM",
976
- "MB",
977
- "freebsd",
978
- "System.ram",
979
- 200,
980
- update_every,
981
- RRDSET_TYPE_STACKED
984
+ st = rrdset_create_localhost(
985
+ "system",
986
+ "ram",
987
+ NULL,
988
+ "ram",
989
+ NULL,
990
+ "System RAM",
991
+ "MB",
992
+ "freebsd",
993
+ "system.ram",
994
+ 200,
995
+ update_every,
996
+ RRDSET_TYPE_STACKED
997
);
998
999
rd_free = rrddim_add(st, "free", NULL, system_pagesize, MEGA_FACTOR, RRD_ALGORITHM_ABSOLUTE);
@@ -1027,18 +1042,19 @@ int do_vm_stats_sys_v_swappgs(int update_every, usec_t dt) {
1042
static RRDDIM *rd_in = NULL, *rd_out = NULL;
1043
1044
if (unlikely(!st)) {
1030
- st = rrdset_create_localhost("system",
1031
- "swapio",
1032
- NULL,
1033
- "swap",
1034
- NULL,
1035
- "Swap I/O",
1036
- "kilobytes/s",
1037
- "freebsd",
1038
- "vm.stats.vm.v_swappgs",
1039
- 250,
1040
- update_every,
1041
- RRDSET_TYPE_AREA
1045
+ st = rrdset_create_localhost(
1046
+ "system",
1047
+ "swapio",
1048
+ NULL,
1049
+ "swap",
1050
+ NULL,
1051
+ "Swap I/O",
1052
+ "kilobytes/s",
1053
+ "freebsd",
1054
+ "vm.stats.vm.v_swappgs",
1055
+ 250,
1056
+ update_every,
1057
+ RRDSET_TYPE_AREA
1058
);
1059
1060
rd_in = rrddim_add(st, "in", NULL, system_pagesize, KILO_FACTOR, RRD_ALGORITHM_INCREMENTAL);
@@ -1080,18 +1096,19 @@ int do_vm_stats_sys_v_pgfaults(int update_every, usec_t dt) {
1096
*rd_cow_optimized = NULL, *rd_in_transit = NULL;
1097
1098
if (unlikely(!st)) {
1083
- st = rrdset_create_localhost("mem",
1084
- "pgfaults",
1085
- NULL,
1086
- "system",
1087
- NULL,
1088
- "Memory Page Faults",
1089
- "page faults/s",
1090
- "freebsd",
1091
- "vm.stats.vm.v_pgfaults",
1092
- 500,
1093
- update_every,
1094
- RRDSET_TYPE_LINE
1099
+ st = rrdset_create_localhost(
1100
+ "mem",
1101
+ "pgfaults",
1102
+ NULL,
1103
+ "system",
1104
+ NULL,
1105
+ "Memory Page Faults",
1106
+ "page faults/s",
1107
+ "freebsd",
1108
+ "vm.stats.vm.v_pgfaults",
1109
+ 500,
1110
+ update_every,
1111
+ RRDSET_TYPE_LINE
1112
);
1113
1114
rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
@@ -1161,18 +1178,19 @@ int do_kern_ipc_sem(int update_every, usec_t dt) {
1178
static RRDDIM *rd_semaphores = NULL, *rd_semaphore_arrays = NULL;
1179
1180
if (unlikely(!st_semaphores)) {
1164
- st_semaphores = rrdset_create_localhost("system",
1165
- "ipc_semaphores",
1166
- NULL,
1167
- "ipc semaphores",
1168
- NULL,
1169
- "IPC Semaphores",
1170
- "semaphores",
1171
- "freebsd",
1172
- "kern.ipc.sem",
1173
- 1000,
1174
- update_every,
1175
- RRDSET_TYPE_AREA
1181
+ st_semaphores = rrdset_create_localhost(
1182
+ "system",
1183
+ "ipc_semaphores",
1184
+ NULL,
1185
+ "ipc semaphores",
1186
+ NULL,
1187
+ "IPC Semaphores",
1188
+ "semaphores",
1189
+ "freebsd",
1190
+ "kern.ipc.sem",
1191
+ 1000,
1192
+ update_every,
1193
+ RRDSET_TYPE_AREA
1194
);
1195
1196
rd_semaphores = rrddim_add(st_semaphores, "semaphores", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
@@ -1185,18 +1203,19 @@ int do_kern_ipc_sem(int update_every, usec_t dt) {
1203
// --------------------------------------------------------------------
1204
1205
if (unlikely(!st_semaphore_arrays)) {
1188
- st_semaphore_arrays = rrdset_create_localhost("system",
1189
- "ipc_semaphore_arrays",
1190
- NULL,
1191
- "ipc semaphores",
1192
- NULL,
1193
- "IPC Semaphore Arrays",
1194
- "arrays",
1195
- "freebsd",
1196
- "kern.ipc.sem",
1197
- 1000,
1198
- update_every,
1199
- RRDSET_TYPE_AREA
1206
+ st_semaphore_arrays = rrdset_create_localhost(
1207
+ "system",
1208
+ "ipc_semaphore_arrays",
1209
+ NULL,
1210
+ "ipc semaphores",
1211
+ NULL,
1212
+ "IPC Semaphore Arrays",
1213
+ "arrays",
1214
+ "freebsd",
1215
+ "kern.ipc.sem",
1216
+ 1000,
1217
+ update_every,
1218
+ RRDSET_TYPE_AREA
1219
);
1220
1221
rd_semaphore_arrays = rrddim_add(st_semaphore_arrays, "arrays", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
@@ -1258,18 +1277,19 @@ int do_kern_ipc_shm(int update_every, usec_t dt) {
1277
static RRDDIM *rd_segments = NULL, *rd_allocated = NULL;
1278
1279
if (unlikely(!st_segs)) {
1261
- st_segs = rrdset_create_localhost("system",
1262
- "ipc_shared_mem_segs",
1263
- NULL,
1264
- "ipc shared memory",
1265
- NULL,
1266
- "IPC Shared Memory Segments",
1267
- "segments",
1268
- "freebsd",
1269
- "kern.ipc.shm",
1270
- 1000,
1271
- update_every,
1272
- RRDSET_TYPE_AREA
1280
+ st_segs = rrdset_create_localhost(
1281
+ "system",
1282
+ "ipc_shared_mem_segs",
1283
+ NULL,
1284
+ "ipc shared memory",
1285
+ NULL,
1286
+ "IPC Shared Memory Segments",
1287
+ "segments",
1288
+ "freebsd",
1289
+ "kern.ipc.shm",
1290
+ 1000,
1291
+ update_every,
1292
+ RRDSET_TYPE_AREA
1293
);
1294
1295
rd_segments = rrddim_add(st_segs, "segments", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
@@ -1282,18 +1302,19 @@ int do_kern_ipc_shm(int update_every, usec_t dt) {
1302
// --------------------------------------------------------------------
1303
1304
if (unlikely(!st_size)) {
1285
- st_size = rrdset_create_localhost("system",
1286
- "ipc_shared_mem_size",
1287
- NULL,
1288
- "ipc shared memory",
1289
- NULL,
1290
- "IPC Shared Memory Segments Size",
1291
- "kilobytes",
1292
- "freebsd",
1293
- "kern.ipc.shm",
1294
- 1000,
1295
- update_every,
1296
- RRDSET_TYPE_AREA
1305
+ st_size = rrdset_create_localhost(
1306
+ "system",
1307
+ "ipc_shared_mem_size",
1308
+ NULL,
1309
+ "ipc shared memory",
1310
+ NULL,
1311
+ "IPC Shared Memory Segments Size",
1312
+ "kilobytes",
1313
+ "freebsd",
1314
+ "kern.ipc.shm",
1315
+ 1000,
1316
+ update_every,
1317
+ RRDSET_TYPE_AREA
1318
);
1319
1320
rd_allocated = rrddim_add(st_size, "allocated", NULL, 1, KILO_FACTOR, RRD_ALGORITHM_ABSOLUTE);
@@ -1361,18 +1382,19 @@ int do_kern_ipc_msq(int update_every, usec_t dt) {
1382
static RRDDIM *rd_queues = NULL, *rd_messages = NULL, *rd_allocated = NULL, *rd_used = NULL;
1383
1384
if (unlikely(!st_queues)) {
1364
- st_queues = rrdset_create_localhost("system",
1365
- "ipc_msq_queues",
1366
- NULL,
1367
- "ipc message queues",
1368
- NULL,
1369
- "Number of IPC Message Queues",
1370
- "queues",
1371
- "freebsd",
1372
- "kern.ipc.msq",
1373
- 990,
1374
- update_every,
1375
- RRDSET_TYPE_AREA
1385
+ st_queues = rrdset_create_localhost(
1386
+ "system",
1387
+ "ipc_msq_queues",
1388
+ NULL,
1389
+ "ipc message queues",
1390
+ NULL,
1391
+ "Number of IPC Message Queues",
1392
+ "queues",
1393
+ "freebsd",
1394
+ "kern.ipc.msq",
1395
+ 990,
1396
+ update_every,
1397
+ RRDSET_TYPE_AREA
1398
);
1399
1400
rd_queues = rrddim_add(st_queues, "queues", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
@@ -1385,18 +1407,19 @@ int do_kern_ipc_msq(int update_every, usec_t dt) {
1407
// --------------------------------------------------------------------
1408
1409
if (unlikely(!st_messages)) {
1388
- st_messages = rrdset_create_localhost("system",
1389
- "ipc_msq_messages",
1390
- NULL,
1391
- "ipc message queues",
1392
- NULL,
1393
- "Number of Messages in IPC Message Queues",
1394
- "messages",
1395
- "freebsd",
1396
- "kern.ipc.msq",
1397
- 1000,
1398
- update_every,
1399
- RRDSET_TYPE_AREA
1410
+ st_messages = rrdset_create_localhost(
1411
+ "system",
1412
+ "ipc_msq_messages",
1413
+ NULL,
1414
+ "ipc message queues",
1415
+ NULL,
1416
+ "Number of Messages in IPC Message Queues",
1417
+ "messages",
1418
+ "freebsd",
1419
+ "kern.ipc.msq",
1420
+ 1000,
1421
+ update_every,
1422
+ RRDSET_TYPE_AREA
1423
);
1424
1425
rd_messages = rrddim_add(st_messages, "messages", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
@@ -1409,18 +1432,19 @@ int do_kern_ipc_msq(int update_every, usec_t dt) {
1432
// --------------------------------------------------------------------
1433
1434
if (unlikely(!st_size)) {
1412
- st_size = rrdset_create_localhost("system",
1413
- "ipc_msq_size",
1414
- NULL,
1415
- "ipc message queues",
1416
- NULL,
1417
- "Size of IPC Message Queues",
1418
- "bytes",
1419
- "freebsd",
1420
- "kern.ipc.msq",
1421
- 1100,
1422
- update_every,
1423
- RRDSET_TYPE_LINE
1435
+ st_size = rrdset_create_localhost(
1436
+ "system",
1437
+ "ipc_msq_size",
1438
+ NULL,
1439
+ "ipc message queues",
1440
+ NULL,
1441
+ "Size of IPC Message Queues",
1442
+ "bytes",
1443
+ "freebsd",
1444
+ "kern.ipc.msq",
1445
+ 1100,
1446
+ update_every,
1447
+ RRDSET_TYPE_LINE
1448
);
1449
1450
rd_allocated = rrddim_add(st_size, "allocated", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
@@ -1452,18 +1476,19 @@ int do_uptime(int update_every, usec_t dt) {
1476
static RRDDIM *rd = NULL;
1477
1478
if(unlikely(!st)) {
1455
- st = rrdset_create_localhost("system",
1456
- "uptime",
1457
- NULL,
1458
- "uptime",
1459
- NULL,
1460
- "System Uptime",
1461
- "seconds",
1462
- "freebsd",
1463
- "uptime",
1464
- 1000,
1465
- update_every,
1466
- RRDSET_TYPE_LINE
1479
+ st = rrdset_create_localhost(
1480
+ "system",
1481
+ "uptime",
1482
+ NULL,
1483
+ "uptime",
1484
+ NULL,
1485
+ "System Uptime",
1486
+ "seconds",
1487
+ "freebsd",
1488
+ "uptime",
1489
+ 1000,
1490
+ update_every,
1491
+ RRDSET_TYPE_LINE
1492
);
1493
1494
rd = rrddim_add(st, "uptime", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
@@ -1579,18 +1604,19 @@ int do_net_isr(int update_every, usec_t dt) {
1604
static RRDDIM *rd_dispatched = NULL, *rd_hybrid_dispatched = NULL, *rd_qdrops = NULL, *rd_queued = NULL;
1605
1606
if (unlikely(!st)) {
1582
- st = rrdset_create_localhost("system",
1583
- "softnet_stat",
1584
- NULL,
1585
- "softnet_stat",
1586
- NULL,
1587
- "System softnet_stat",
1588
- "events/s",
1589
- "freebsd",
1590
- "net.isr",
1591
- 955,
1592
- update_every,
1593
- RRDSET_TYPE_LINE
1607
+ st = rrdset_create_localhost(
1608
+ "system",
1609
+ "softnet_stat",
1610
+ NULL,
1611
+ "softnet_stat",
1612
+ NULL,
1613
+ "System softnet_stat",
1614
+ "events/s",
1615
+ "freebsd",
1616
+ "net.isr",
1617
+ 955,
1618
+ update_every,
1619
+ RRDSET_TYPE_LINE
1620
);
1621
1622
rd_dispatched = rrddim_add(st, "dispatched", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -1631,18 +1657,19 @@ int do_net_isr(int update_every, usec_t dt) {
1657
snprintfz(all_softnet_charts[i].netisr_cpuid, MAX_INT_DIGITS + 17, "cpu%d_softnet_stat", i);
1658
1659
if (unlikely(!all_softnet_charts[i].st)) {
1634
- all_softnet_charts[i].st = rrdset_create_localhost("cpu",
1635
- all_softnet_charts[i].netisr_cpuid,
1636
- NULL,
1637
- "softnet_stat",
1638
- NULL,
1639
- "Per CPU netisr statistics",
1640
- "events/s",
1641
- "freebsd",
1642
- "net.isr",
1643
- 1101 + i,
1644
- update_every,
1645
- RRDSET_TYPE_LINE
1660
+ all_softnet_charts[i].st = rrdset_create_localhost(
1661
+ "cpu",
1662
+ all_softnet_charts[i].netisr_cpuid,
1663
+ NULL,
1664
+ "softnet_stat",
1665
+ NULL,
1666
+ "Per CPU netisr statistics",
1667
+ "events/s",
1668
+ "freebsd",
1669
+ "net.isr",
1670
+ 1101 + i,
1671
+ update_every,
1672
+ RRDSET_TYPE_LINE
1673
);
1674
1675
all_softnet_charts[i].rd_dispatched = rrddim_add(all_softnet_charts[i].st, "dispatched",
@@ -1692,18 +1719,19 @@ int do_net_inet_tcp_states(int update_every, usec_t dt) {
1719
static RRDDIM *rd = NULL;
1720
1721
if (unlikely(!st)) {
1695
- st = rrdset_create_localhost("ipv4",
1696
- "tcpsock",
1697
- NULL,
1698
- "tcp",
1699
- NULL,
1700
- "IPv4 TCP Connections",
1701
- "active connections",
1702
- "freebsd",
1703
- "net.inet.tcp.states",
1704
- 2500,
1705
- update_every,
1706
- RRDSET_TYPE_LINE
1722
+ st = rrdset_create_localhost(
1723
+ "ipv4",
1724
+ "tcpsock",
1725
+ NULL,
1726
+ "tcp",
1727
+ NULL,
1728
+ "IPv4 TCP Connections",
1729
+ "active connections",
1730
+ "freebsd",
1731
+ "net.inet.tcp.states",
1732
+ 2500,
1733
+ update_every,
1734
+ RRDSET_TYPE_LINE
1735
);
1736
1737
rd = rrddim_add(st, "CurrEstab", "connections", 1, 1, RRD_ALGORITHM_ABSOLUTE);
@@ -1769,18 +1797,19 @@ int do_net_inet_tcp_stats(int update_every, usec_t dt) {
1797
static RRDDIM *rd_in_segs = NULL, *rd_out_segs = NULL;
1798
1799
if (unlikely(!st)) {
1772
- st = rrdset_create_localhost("ipv4",
1773
- "tcppackets",
1774
- NULL,
1775
- "tcp",
1776
- NULL,
1777
- "IPv4 TCP Packets",
1778
- "packets/s",
1779
- "freebsd",
1780
- "net.inet.tcp.stats",
1781
- 2600,
1782
- update_every,
1783
- RRDSET_TYPE_LINE
1800
+ st = rrdset_create_localhost(
1801
+ "ipv4",
1802
+ "tcppackets",
1803
+ NULL,
1804
+ "tcp",
1805
+ NULL,
1806
+ "IPv4 TCP Packets",
1807
+ "packets/s",
1808
+ "freebsd",
1809
+ "net.inet.tcp.stats",
1810
+ 2600,
1811
+ update_every,
1812
+ RRDSET_TYPE_LINE
1813
);
1814
1815
rd_in_segs = rrddim_add(st, "InSegs", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -1800,18 +1829,19 @@ int do_net_inet_tcp_stats(int update_every, usec_t dt) {
1829
static RRDDIM *rd_in_errs = NULL, *rd_in_csum_errs = NULL, *rd_retrans_segs = NULL;
1830
1831
if (unlikely(!st)) {
1803
- st = rrdset_create_localhost("ipv4",
1804
- "tcperrors",
1805
- NULL,
1806
- "tcp",
1807
- NULL,
1808
- "IPv4 TCP Errors",
1809
- "packets/s",
1810
- "freebsd",
1811
- "net.inet.tcp.stats",
1812
- 2700,
1813
- update_every,
1814
- RRDSET_TYPE_LINE
1832
+ st = rrdset_create_localhost(
1833
+ "ipv4",
1834
+ "tcperrors",
1835
+ NULL,
1836
+ "tcp",
1837
+ NULL,
1838
+ "IPv4 TCP Errors",
1839
+ "packets/s",
1840
+ "freebsd",
1841
+ "net.inet.tcp.stats",
1842
+ 2700,
1843
+ update_every,
1844
+ RRDSET_TYPE_LINE
1845
);
1846
1847
rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
@@ -1841,18 +1871,19 @@ int do_net_inet_tcp_stats(int update_every, usec_t dt) {
1871
*rd_attempt_fails = NULL;
1872
1873
if (unlikely(!st)) {
1844
- st = rrdset_create_localhost("ipv4",
1845
- "tcphandshake",
1846
- NULL,
1847
- "tcp",
1848
- NULL,
1849
- "IPv4 TCP Handshake Issues",
1850
- "events/s",
1851
- "freebsd",
1852
- "net.inet.tcp.stats",
1853
- 2900,
1854
- update_every,
1855
- RRDSET_TYPE_LINE
1874
+ st = rrdset_create_localhost(
1875
+ "ipv4",
1876
+ "tcphandshake",
1877
+ NULL,
1878
+ "tcp",
1879
+ NULL,
1880
+ "IPv4 TCP Handshake Issues",
1881
+ "events/s",
1882
+ "freebsd",
1883
+ "net.inet.tcp.stats",
1884
+ 2900,
1885
+ update_every,
1886
+ RRDSET_TYPE_LINE
1887
);
1888
1889
rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
@@ -1881,18 +1912,19 @@ int do_net_inet_tcp_stats(int update_every, usec_t dt) {
1912
*rd_on_timeout = NULL, *rd_on_linger = NULL;
1913
1914
if (unlikely(!st)) {
1884
- st = rrdset_create_localhost("ipv4",
1885
- "tcpconnaborts",
1886
- NULL,
1887
- "tcp",
1888
- NULL,
1889
- "TCP Connection Aborts",
1890
- "connections/s",
1891
- "freebsd",
1892
- "net.inet.tcp.stats",
1893
- 3010,
1894
- update_every,
1895
- RRDSET_TYPE_LINE
1915
+ st = rrdset_create_localhost(
1916
+ "ipv4",
1917
+ "tcpconnaborts",
1918
+ NULL,
1919
+ "tcp",
1920
+ NULL,
1921
+ "TCP Connection Aborts",
1922
+ "connections/s",
1923
+ "freebsd",
1924
+ "net.inet.tcp.stats",
1925
+ 3010,
1926
+ update_every,
1927
+ RRDSET_TYPE_LINE
1928
);
1929
1930
rd_on_data = rrddim_add(st, "TCPAbortOnData", "baddata", 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -1920,18 +1952,19 @@ int do_net_inet_tcp_stats(int update_every, usec_t dt) {
1952
static RRDDIM *rd_ofo_queue = NULL;
1953
1954
if (unlikely(!st)) {
1923
- st = rrdset_create_localhost("ipv4",
1924
- "tcpofo",
1925
- NULL,
1926
- "tcp",
1927
- NULL,
1928
- "TCP Out-Of-Order Queue",
1929
- "packets/s",
1930
- "freebsd",
1931
- "net.inet.tcp.stats",
1932
- 3050,
1933
- update_every,
1934
- RRDSET_TYPE_LINE
1955
+ st = rrdset_create_localhost(
1956
+ "ipv4",
1957
+ "tcpofo",
1958
+ NULL,
1959
+ "tcp",
1960
+ NULL,
1961
+ "TCP Out-Of-Order Queue",
1962
+ "packets/s",
1963
+ "freebsd",
1964
+ "net.inet.tcp.stats",
1965
+ 3050,
1966
+ update_every,
1967
+ RRDSET_TYPE_LINE
1968
);
1969
1970
rd_ofo_queue = rrddim_add(st, "TCPOFOQueue", "inqueue", 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -1951,18 +1984,19 @@ int do_net_inet_tcp_stats(int update_every, usec_t dt) {
1984
static RRDDIM *rd_recv = NULL, *rd_send = NULL, *rd_failed = NULL;
1985
1986
if (unlikely(!st)) {
1954
- st = rrdset_create_localhost("ipv4",
1955
- "tcpsyncookies",
1956
- NULL,
1957
- "tcp",
1958
- NULL,
1959
- "TCP SYN Cookies",
1960
- "packets/s",
1961
- "freebsd",
1962
- "net.inet.tcp.stats",
1963
- 3100,
1964
- update_every,
1965
- RRDSET_TYPE_LINE
1987
+ st = rrdset_create_localhost(
1988
+ "ipv4",
1989
+ "tcpsyncookies",
1990
+ NULL,
1991
+ "tcp",
1992
+ NULL,
1993
+ "TCP SYN Cookies",
1994
+ "packets/s",
1995
+ "freebsd",
1996
+ "net.inet.tcp.stats",
1997
+ 3100,
1998
+ update_every,
1999
+ RRDSET_TYPE_LINE
2000
);
2001
2002
rd_recv = rrddim_add(st, "SyncookiesRecv", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -1986,18 +2020,19 @@ int do_net_inet_tcp_stats(int update_every, usec_t dt) {
2020
static RRDDIM *rd_ce = NULL, *rd_no_ect = NULL, *rd_ect0 = NULL, *rd_ect1 = NULL;
2021
2022
if (unlikely(!st)) {
1989
- st = rrdset_create_localhost("ipv4",
1990
- "ecnpkts",
1991
- NULL,
1992
- "ecn",
1993
- NULL,
1994
- "IPv4 ECN Statistics",
1995
- "packets/s",
1996
- "freebsd",
1997
- "net.inet.tcp.stats",
1998
- 8700,
1999
- update_every,
2000
- RRDSET_TYPE_LINE
2023
+ st = rrdset_create_localhost(
2024
+ "ipv4",
2025
+ "ecnpkts",
2026
+ NULL,
2027
+ "ecn",
2028
+ NULL,
2029
+ "IPv4 ECN Statistics",
2030
+ "packets/s",
2031
+ "freebsd",
2032
+ "net.inet.tcp.stats",
2033
+ 8700,
2034
+ update_every,
2035
+ RRDSET_TYPE_LINE
2036
);
2037
2038
rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
@@ -2059,18 +2094,19 @@ int do_net_inet_udp_stats(int update_every, usec_t dt) {
2094
static RRDDIM *rd_in = NULL, *rd_out = NULL;
2095
2096
if (unlikely(!st)) {
2062
- st = rrdset_create_localhost("ipv4",
2063
- "udppackets",
2064
- NULL,
2065
- "udp",
2066
- NULL,
2067
- "IPv4 UDP Packets",
2068
- "packets/s",
2069
- "freebsd",
2070
- "net.inet.udp.stats",
2071
- 2601,
2072
- update_every,
2073
- RRDSET_TYPE_LINE
2097
+ st = rrdset_create_localhost(
2098
+ "ipv4",
2099
+ "udppackets",
2100
+ NULL,
2101
+ "udp",
2102
+ NULL,
2103
+ "IPv4 UDP Packets",
2104
+ "packets/s",
2105
+ "freebsd",
2106
+ "net.inet.udp.stats",
2107
+ 2601,
2108
+ update_every,
2109
+ RRDSET_TYPE_LINE
2110
);
2111
2112
rd_in = rrddim_add(st, "InDatagrams", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -2091,18 +2127,19 @@ int do_net_inet_udp_stats(int update_every, usec_t dt) {
2127
*rd_in_csum_errors = NULL, *rd_ignored_multi = NULL;
2128
2129
if (unlikely(!st)) {
2094
- st = rrdset_create_localhost("ipv4",
2095
- "udperrors",
2096
- NULL,
2097
- "udp",
2098
- NULL,
2099
- "IPv4 UDP Errors",
2100
- "events/s",
2101
- "freebsd",
2102
- "net.inet.udp.stats",
2103
- 2701,
2104
- update_every,
2105
- RRDSET_TYPE_LINE
2130
+ st = rrdset_create_localhost(
2131
+ "ipv4",
2132
+ "udperrors",
2133
+ NULL,
2134
+ "udp",
2135
+ NULL,
2136
+ "IPv4 UDP Errors",
2137
+ "events/s",
2138
+ "freebsd",
2139
+ "net.inet.udp.stats",
2140
+ 2701,
2141
+ update_every,
2142
+ RRDSET_TYPE_LINE
2143
);
2144
2145
rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
@@ -2323,18 +2360,19 @@ int do_net_inet_ip_stats(int update_every, usec_t dt) {
2360
*rd_in_delivers = NULL;
2361
2362
if (unlikely(!st)) {
2326
- st = rrdset_create_localhost("ipv4",
2327
- "packets",
2328
- NULL,
2329
- "packets",
2330
- NULL,
2331
- "IPv4 Packets",
2332
- "packets/s",
2333
- "freebsd",
2334
- "net.inet.ip.stats",
2335
- 3000,
2336
- update_every,
2337
- RRDSET_TYPE_LINE
2363
+ st = rrdset_create_localhost(
2364
+ "ipv4",
2365
+ "packets",
2366
+ NULL,
2367
+ "packets",
2368
+ NULL,
2369
+ "IPv4 Packets",
2370
+ "packets/s",
2371
+ "freebsd",
2372
+ "net.inet.ip.stats",
2373
+ 3000,
2374
+ update_every,
2375
+ RRDSET_TYPE_LINE
2376
);
2377
2378
rd_in_receives = rrddim_add(st, "InReceives", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -2358,18 +2396,19 @@ int do_net_inet_ip_stats(int update_every, usec_t dt) {
2396
static RRDDIM *rd_ok = NULL, *rd_fails = NULL, *rd_created = NULL;
2397
2398
if (unlikely(!st)) {
2361
- st = rrdset_create_localhost("ipv4",
2362
- "fragsout",
2363
- NULL,
2364
- "fragments",
2365
- NULL,
2366
- "IPv4 Fragments Sent",
2367
- "packets/s",
2368
- "freebsd",
2369
- "net.inet.ip.stats",
2370
- 3010,
2371
- update_every,
2372
- RRDSET_TYPE_LINE
2399
+ st = rrdset_create_localhost(
2400
+ "ipv4",
2401
+ "fragsout",
2402
+ NULL,
2403
+ "fragments",
2404
+ NULL,
2405
+ "IPv4 Fragments Sent",
2406
+ "packets/s",
2407
+ "freebsd",
2408
+ "net.inet.ip.stats",
2409
+ 3010,
2410
+ update_every,
2411
+ RRDSET_TYPE_LINE
2412
);
2413
2414
rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
@@ -2393,18 +2432,19 @@ int do_net_inet_ip_stats(int update_every, usec_t dt) {
2432
static RRDDIM *rd_ok = NULL, *rd_failed = NULL, *rd_all = NULL;
2433
2434
if (unlikely(!st)) {
2396
- st = rrdset_create_localhost("ipv4",
2397
- "fragsin",
2398
- NULL,
2399
- "fragments",
2400
- NULL,
2401
- "IPv4 Fragments Reassembly",
2402
- "packets/s",
2403
- "freebsd",
2404
- "net.inet.ip.stats",
2405
- 3011,
2406
- update_every,
2407
- RRDSET_TYPE_LINE
2435
+ st = rrdset_create_localhost(
2436
+ "ipv4",
2437
+ "fragsin",
2438
+ NULL,
2439
+ "fragments",
2440
+ NULL,
2441
+ "IPv4 Fragments Reassembly",
2442
+ "packets/s",
2443
+ "freebsd",
2444
+ "net.inet.ip.stats",
2445
+ 3011,
2446
+ update_every,
2447
+ RRDSET_TYPE_LINE
2448
);
2449
2450
rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
@@ -2430,18 +2470,19 @@ int do_net_inet_ip_stats(int update_every, usec_t dt) {
2470
*rd_in_addr_errors = NULL, *rd_in_unknown_protos = NULL;
2471
2472
if (unlikely(!st)) {
2433
- st = rrdset_create_localhost("ipv4",
2434
- "errors",
2435
- NULL,
2436
- "errors",
2437
- NULL,
2438
- "IPv4 Errors",
2439
- "packets/s",
2440
- "freebsd",
2441
- "net.inet.ip.stats",
2442
- 3002,
2443
- update_every,
2444
- RRDSET_TYPE_LINE
2473
+ st = rrdset_create_localhost(
2474
+ "ipv4",
2475
+ "errors",
2476
+ NULL,
2477
+ "errors",
2478
+ NULL,
2479
+ "IPv4 Errors",
2480
+ "packets/s",
2481
+ "freebsd",
2482
+ "net.inet.ip.stats",
2483
+ 3002,
2484
+ update_every,
2485
+ RRDSET_TYPE_LINE
2486
);
2487
2488
rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
@@ -2520,18 +2561,19 @@ int do_net_inet6_ip6_stats(int update_every, usec_t dt) {
2561
static RRDDIM *rd_received = NULL, *rd_sent = NULL, *rd_forwarded = NULL, *rd_delivers = NULL;
2562
2563
if (unlikely(!st)) {
2523
- st = rrdset_create_localhost("ipv6",
2524
- "packets",
2525
- NULL,
2526
- "packets",
2527
- NULL,
2528
- "IPv6 Packets",
2529
- "packets/s",
2530
- "freebsd",
2531
- "net.inet6.ip6.stats",
2532
- 3000,
2533
- update_every,
2534
- RRDSET_TYPE_LINE
2564
+ st = rrdset_create_localhost(
2565
+ "ipv6",
2566
+ "packets",
2567
+ NULL,
2568
+ "packets",
2569
+ NULL,
2570
+ "IPv6 Packets",
2571
+ "packets/s",
2572
+ "freebsd",
2573
+ "net.inet6.ip6.stats",
2574
+ 3000,
2575
+ update_every,
2576
+ RRDSET_TYPE_LINE
2577
);
2578
2579
rd_received = rrddim_add(st, "received", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -2559,18 +2601,19 @@ int do_net_inet6_ip6_stats(int update_every, usec_t dt) {
2601
static RRDDIM *rd_ok = NULL, *rd_failed = NULL, *rd_all = NULL;
2602
2603
if (unlikely(!st)) {
2562
- st = rrdset_create_localhost("ipv6",
2563
- "fragsout",
2564
- NULL,
2565
- "fragments",
2566
- NULL,
2567
- "IPv6 Fragments Sent",
2568
- "packets/s",
2569
- "freebsd",
2570
- "net.inet6.ip6.stats",
2571
- 3010,
2572
- update_every,
2573
- RRDSET_TYPE_LINE
2604
+ st = rrdset_create_localhost(
2605
+ "ipv6",
2606
+ "fragsout",
2607
+ NULL,
2608
+ "fragments",
2609
+ NULL,
2610
+ "IPv6 Fragments Sent",
2611
+ "packets/s",
2612
+ "freebsd",
2613
+ "net.inet6.ip6.stats",
2614
+ 3010,
2615
+ update_every,
2616
+ RRDSET_TYPE_LINE
2617
);
2618
2619
rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
@@ -2598,18 +2641,19 @@ int do_net_inet6_ip6_stats(int update_every, usec_t dt) {
2641
static RRDDIM *rd_ok = NULL, *rd_failed = NULL, *rd_timeout = NULL, *rd_all = NULL;
2642
2643
if (unlikely(!st)) {
2601
- st = rrdset_create_localhost("ipv6",
2602
- "fragsin",
2603
- NULL,
2604
- "fragments",
2605
- NULL,
2606
- "IPv6 Fragments Reassembly",
2607
- "packets/s",
2608
- "freebsd",
2609
- "net.inet6.ip6.stats",
2610
- 3011,
2611
- update_every,
2612
- RRDSET_TYPE_LINE
2644
+ st = rrdset_create_localhost(
2645
+ "ipv6",
2646
+ "fragsin",
2647
+ NULL,
2648
+ "fragments",
2649
+ NULL,
2650
+ "IPv6 Fragments Reassembly",
2651
+ "packets/s",
2652
+ "freebsd",
2653
+ "net.inet6.ip6.stats",
2654
+ 3011,
2655
+ update_every,
2656
+ RRDSET_TYPE_LINE
2657
);
2658
2659
rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
@@ -2648,18 +2692,19 @@ int do_net_inet6_ip6_stats(int update_every, usec_t dt) {
2692
*rd_in_no_routes = NULL, *rd_out_no_routes = NULL;
2693
2694
if (unlikely(!st)) {
2651
- st = rrdset_create_localhost("ipv6",
2652
- "errors",
2653
- NULL,
2654
- "errors",
2655
- NULL,
2656
- "IPv6 Errors",
2657
- "packets/s",
2658
- "freebsd",
2659
- "net.inet6.ip6.stats",
2660
- 3002,
2661
- update_every,
2662
- RRDSET_TYPE_LINE
2695
+ st = rrdset_create_localhost(
2696
+ "ipv6",
2697
+ "errors",
2698
+ NULL,
2699
+ "errors",
2700
+ NULL,
2701
+ "IPv6 Errors",
2702
+ "packets/s",
2703
+ "freebsd",
2704
+ "net.inet6.ip6.stats",
2705
+ 3002,
2706
+ update_every,
2707
+ RRDSET_TYPE_LINE
2708
);
2709
2710
rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
@@ -2761,18 +2806,19 @@ int do_net_inet6_icmp6_stats(int update_every, usec_t dt) {
2806
static RRDDIM *rd_received = NULL, *rd_sent = NULL;
2807
2808
if (unlikely(!st)) {
2764
- st = rrdset_create_localhost("ipv6",
2765
- "icmp",
2766
- NULL,
2767
- "icmp",
2768
- NULL,
2769
- "IPv6 ICMP Messages",
2770
- "messages/s",
2771
- "freebsd",
2772
- "net.inet6.icmp6.stats",
2773
- 10000,
2774
- update_every,
2775
- RRDSET_TYPE_LINE
2809
+ st = rrdset_create_localhost(
2810
+ "ipv6",
2811
+ "icmp",
2812
+ NULL,
2813
+ "icmp",
2814
+ NULL,
2815
+ "IPv6 ICMP Messages",
2816
+ "messages/s",
2817
+ "freebsd",
2818
+ "net.inet6.icmp6.stats",
2819
+ 10000,
2820
+ update_every,
2821
+ RRDSET_TYPE_LINE
2822
);
2823
2824
rd_received = rrddim_add(st, "received", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -2795,18 +2841,19 @@ int do_net_inet6_icmp6_stats(int update_every, usec_t dt) {
2841
static RRDDIM *rd_received = NULL, *rd_sent = NULL;
2842
2843
if (unlikely(!st)) {
2798
- st = rrdset_create_localhost("ipv6",
2799
- "icmpredir",
2800
- NULL,
2801
- "icmp",
2802
- NULL,
2803
- "IPv6 ICMP Redirects",
2804
- "redirects/s",
2805
- "freebsd",
2806
- "net.inet6.icmp6.stats",
2807
- 10050,
2808
- update_every,
2809
- RRDSET_TYPE_LINE
2844
+ st = rrdset_create_localhost(
2845
+ "ipv6",
2846
+ "icmpredir",
2847
+ NULL,
2848
+ "icmp",
2849
+ NULL,
2850
+ "IPv6 ICMP Redirects",
2851
+ "redirects/s",
2852
+ "freebsd",
2853
+ "net.inet6.icmp6.stats",
2854
+ 10050,
2855
+ update_every,
2856
+ RRDSET_TYPE_LINE
2857
);
2858
2859
rd_received = rrddim_add(st, "received", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -2842,17 +2889,18 @@ int do_net_inet6_icmp6_stats(int update_every, usec_t dt) {
2889
*rd_out_parm_problems = NULL;
2890
2891
if (unlikely(!st)) {
2845
- st = rrdset_create_localhost("ipv6",
2846
- "icmperrors",
2847
- NULL, "icmp",
2848
- NULL,
2849
- "IPv6 ICMP Errors",
2850
- "errors/s",
2851
- "freebsd",
2852
- "net.inet6.icmp6.stats",
2853
- 10100,
2854
- update_every,
2855
- RRDSET_TYPE_LINE
2892
+ st = rrdset_create_localhost(
2893
+ "ipv6",
2894
+ "icmperrors",
2895
+ NULL, "icmp",
2896
+ NULL,
2897
+ "IPv6 ICMP Errors",
2898
+ "errors/s",
2899
+ "freebsd",
2900
+ "net.inet6.icmp6.stats",
2901
+ 10100,
2902
+ update_every,
2903
+ RRDSET_TYPE_LINE
2904
);
2905
2906
rd_in_errors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -2895,18 +2943,19 @@ int do_net_inet6_icmp6_stats(int update_every, usec_t dt) {
2943
static RRDDIM *rd_in = NULL, *rd_out = NULL, *rd_in_replies = NULL, *rd_out_replies = NULL;
2944
2945
if (unlikely(!st)) {
2898
- st = rrdset_create_localhost("ipv6",
2899
- "icmpechos",
2900
- NULL,
2901
- "icmp",
2902
- NULL,
2903
- "IPv6 ICMP Echo",
2904
- "messages/s",
2905
- "freebsd",
2906
- "net.inet6.icmp6.stats",
2907
- 10200,
2908
- update_every,
2909
- RRDSET_TYPE_LINE
2946
+ st = rrdset_create_localhost(
2947
+ "ipv6",
2948
+ "icmpechos",
2949
+ NULL,
2950
+ "icmp",
2951
+ NULL,
2952
+ "IPv6 ICMP Echo",
2953
+ "messages/s",
2954
+ "freebsd",
2955
+ "net.inet6.icmp6.stats",
2956
+ 10200,
2957
+ update_every,
2958
+ RRDSET_TYPE_LINE
2959
);
2960
2961
rd_in = rrddim_add(st, "InEchos", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -2937,18 +2986,19 @@ int do_net_inet6_icmp6_stats(int update_every, usec_t dt) {
2986
*rd_in_advertisements = NULL, *rd_out_advertisements = NULL;
2987
2988
if (unlikely(!st)) {
2940
- st = rrdset_create_localhost("ipv6",
2941
- "icmprouter",
2942
- NULL,
2943
- "icmp",
2944
- NULL,
2945
- "IPv6 Router Messages",
2946
- "messages/s",
2947
- "freebsd",
2948
- "net.inet6.icmp6.stats",
2949
- 10400,
2950
- update_every,
2951
- RRDSET_TYPE_LINE
2989
+ st = rrdset_create_localhost(
2990
+ "ipv6",
2991
+ "icmprouter",
2992
+ NULL,
2993
+ "icmp",
2994
+ NULL,
2995
+ "IPv6 Router Messages",
2996
+ "messages/s",
2997
+ "freebsd",
2998
+ "net.inet6.icmp6.stats",
2999
+ 10400,
3000
+ update_every,
3001
+ RRDSET_TYPE_LINE
3002
);
3003
3004
rd_in_solicits = rrddim_add(st, "InSolicits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -2979,18 +3029,19 @@ int do_net_inet6_icmp6_stats(int update_every, usec_t dt) {
3029
*rd_in_advertisements = NULL, *rd_out_advertisements = NULL;
3030
3031
if (unlikely(!st)) {
2982
- st = rrdset_create_localhost("ipv6",
2983
- "icmpneighbor",
2984
- NULL,
2985
- "icmp",
2986
- NULL,
2987
- "IPv6 Neighbor Messages",
2988
- "messages/s",
2989
- "freebsd",
2990
- "net.inet6.icmp6.stats",
2991
- 10500,
2992
- update_every,
2993
- RRDSET_TYPE_LINE
3032
+ st = rrdset_create_localhost(
3033
+ "ipv6",
3034
+ "icmpneighbor",
3035
+ NULL,
3036
+ "icmp",
3037
+ NULL,
3038
+ "IPv6 Neighbor Messages",
3039
+ "messages/s",
3040
+ "freebsd",
3041
+ "net.inet6.icmp6.stats",
3042
+ 10500,
3043
+ update_every,
3044
+ RRDSET_TYPE_LINE
3045
);
3046
3047
rd_in_solicits = rrddim_add(st, "InSolicits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
@@ -3028,18 +3079,19 @@ int do_net_inet6_icmp6_stats(int update_every, usec_t dt) {
3079
*rd_out_135 = NULL, *rd_out_143 = NULL;
3080
3081
if (unlikely(!st)) {
3031
- st = rrdset_create_localhost("ipv6",
3032
- "icmptypes",
3033
- NULL,
3034
- "icmp",
3035
- NULL,
3036
- "IPv6 ICMP Types",
3037
- "messages/s",
3038
- "freebsd",
3039
- "net.inet6.icmp6.stats",
3040
- 10700,
3041
- update_every,
3042
- RRDSET_TYPE_LINE
3082
+ st = rrdset_create_localhost(
3083
+ "ipv6",
3084
+ "icmptypes",
3085
+ NULL,
3086
+ "icmp",
3087
+ NULL,
3088
+ "IPv6 ICMP Types",
3089
+ "messages/s",
3090
+ "freebsd",
3091
+ "net.inet6.icmp6.stats",
3092
+ 10700,
3093
+ update_every,
3094
+ RRDSET_TYPE_LINE
3095
);
3096
3097
rd_in_1 = rrddim_add(st, "InType1", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
src/global_statistics.c
+58
-33
@@ -114,13 +114,21 @@ inline void global_statistics_copy(struct global_statistics *gs, uint8_t options
114
}
115
116
void global_statistics_charts(void) {
117
- static unsigned long long old_web_requests = 0, old_web_usec = 0,
118
- old_content_size = 0, old_compressed_content_size = 0;
119
-
120
- static collected_number compression_ratio = -1, average_response_time = -1;
121
-
122
- static RRDSET *stcpu = NULL, *stcpu_thread = NULL, *stclients = NULL, *streqs = NULL, *stbytes = NULL, *stduration = NULL,
123
- *stcompression = NULL;
117
+ static unsigned long long old_web_requests = 0,
118
+ old_web_usec = 0,
119
+ old_content_size = 0,
120
+ old_compressed_content_size = 0;
121
+
122
+ static collected_number compression_ratio = -1,
123
+ average_response_time = -1;
124
+
125
+ static RRDSET *stcpu = NULL,
126
+ *stcpu_thread = NULL,
127
+ *stclients = NULL,
128
+ *streqs = NULL,
129
+ *stbytes = NULL,
130
+ *stduration = NULL,
131
+ *stcompression = NULL;
132
133
struct global_statistics gs;
134
struct rusage me, thread;
@@ -130,14 +138,23 @@ void global_statistics_charts(void) {
138
getrusage(RUSAGE_SELF, &me);
139
140
#ifdef __FreeBSD__
133
- if (!stcpu_thread) stcpu_thread = rrdset_find_localhost("netdata.plugin_freebsd_cpu");
134
- if (!stcpu_thread) {
135
- stcpu_thread = rrdset_create_localhost("netdata", "plugin_freebsd_cpu", NULL, "freebsd", NULL
136
- , "NetData FreeBSD Plugin CPU usage", "milliseconds/s", 132000
137
- , localhost->rrd_update_every, RRDSET_TYPE_STACKED);
141
+ if (unlikely(!stcpu_thread)) {
142
+ stcpu_thread = rrdset_create_localhost(
143
+ "netdata"
144
+ , "plugin_freebsd_cpu"
145
+ , NULL
146
+ , "freebsd"
147
+ , NULL
148
+ , "NetData FreeBSD Plugin CPU usage"
149
+ , "milliseconds/s"
150
+ , "netdata"
151
+ , "stats"
152
+ , 132000
153
+ , localhost->rrd_update_every
154
+ , RRDSET_TYPE_STACKED
155
+ );
156
#else
139
- if (!stcpu_thread) stcpu_thread = rrdset_find_localhost("netdata.plugin_proc_cpu");
140
- if (!stcpu_thread) {
157
+ if (unlikely(!stcpu_thread)) {
158
stcpu_thread = rrdset_create_localhost(
159
"netdata"
160
, "plugin_proc_cpu"
@@ -156,7 +173,9 @@ void global_statistics_charts(void) {
173
174
rrddim_add(stcpu_thread, "user", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL);
175
rrddim_add(stcpu_thread, "system", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL);
159
- } else rrdset_next(stcpu_thread);
176
+ }
177
+ else
178
+ rrdset_next(stcpu_thread);
179
180
rrddim_set(stcpu_thread, "user", thread.ru_utime.tv_sec * 1000000ULL + thread.ru_utime.tv_usec);
181
rrddim_set(stcpu_thread, "system", thread.ru_stime.tv_sec * 1000000ULL + thread.ru_stime.tv_usec);
@@ -164,8 +183,7 @@ void global_statistics_charts(void) {
183
184
// ----------------------------------------------------------------
185
167
- if (!stcpu) stcpu = rrdset_find_localhost("netdata.server_cpu");
168
- if (!stcpu) {
186
+ if (unlikely(!stcpu)) {
187
stcpu = rrdset_create_localhost(
188
"netdata"
189
, "server_cpu"
@@ -183,7 +201,9 @@ void global_statistics_charts(void) {
201
202
rrddim_add(stcpu, "user", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL);
203
rrddim_add(stcpu, "system", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL);
186
- } else rrdset_next(stcpu);
204
+ }
205
+ else
206
+ rrdset_next(stcpu);
207
208
rrddim_set(stcpu, "user", me.ru_utime.tv_sec * 1000000ULL + me.ru_utime.tv_usec);
209
rrddim_set(stcpu, "system", me.ru_stime.tv_sec * 1000000ULL + me.ru_stime.tv_usec);
@@ -191,8 +211,7 @@ void global_statistics_charts(void) {
211
212
// ----------------------------------------------------------------
213
194
- if (!stclients) stclients = rrdset_find_localhost("netdata.clients");
195
- if (!stclients) {
214
+ if (unlikely(!stclients)) {
215
stclients = rrdset_create_localhost(
216
"netdata"
217
, "clients"
@@ -209,15 +228,16 @@ void global_statistics_charts(void) {
228
);
229
230
rrddim_add(stclients, "clients", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
212
- } else rrdset_next(stclients);
231
+ }
232
+ else
233
+ rrdset_next(stclients);
234
235
rrddim_set(stclients, "clients", gs.connected_clients);
236
rrdset_done(stclients);
237
238
// ----------------------------------------------------------------
239
219
- if (!streqs) streqs = rrdset_find_localhost("netdata.requests");
220
- if (!streqs) {
240
+ if (unlikely(!streqs)) {
241
streqs = rrdset_create_localhost(
242
"netdata"
243
, "requests"
@@ -234,15 +254,16 @@ void global_statistics_charts(void) {
254
);
255
256
rrddim_add(streqs, "requests", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
237
- } else rrdset_next(streqs);
257
+ }
258
+ else
259
+ rrdset_next(streqs);
260
261
rrddim_set(streqs, "requests", (collected_number) gs.web_requests);
262
rrdset_done(streqs);
263
264
// ----------------------------------------------------------------
265
244
- if (!stbytes) stbytes = rrdset_find_localhost("netdata.net");
245
- if (!stbytes) {
266
+ if (unlikely(!stbytes)) {
267
stbytes = rrdset_create_localhost(
268
"netdata"
269
, "net"
@@ -260,7 +281,9 @@ void global_statistics_charts(void) {
281
282
rrddim_add(stbytes, "in", NULL, 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
283
rrddim_add(stbytes, "out", NULL, -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
263
- } else rrdset_next(stbytes);
284
+ }
285
+ else
286
+ rrdset_next(stbytes);
287
288
rrddim_set(stbytes, "in", (collected_number) gs.bytes_received);
289
rrddim_set(stbytes, "out", (collected_number) gs.bytes_sent);
@@ -268,8 +291,7 @@ void global_statistics_charts(void) {
291
292
// ----------------------------------------------------------------
293
271
- if (!stduration) stduration = rrdset_find_localhost("netdata.response_time");
272
- if (!stduration) {
294
+ if (unlikely(!stduration)) {
295
stduration = rrdset_create_localhost(
296
"netdata"
297
, "response_time"
@@ -287,7 +309,9 @@ void global_statistics_charts(void) {
309
310
rrddim_add(stduration, "average", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
311
rrddim_add(stduration, "max", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
290
- } else rrdset_next(stduration);
312
+ }
313
+ else
314
+ rrdset_next(stduration);
315
316
uint64_t gweb_usec = gs.web_usec;
317
uint64_t gweb_requests = gs.web_requests;
@@ -311,8 +335,7 @@ void global_statistics_charts(void) {
335
336
// ----------------------------------------------------------------
337
314
- if (!stcompression) stcompression = rrdset_find_localhost("netdata.compression_ratio");
315
- if (!stcompression) {
338
+ if (unlikely(!stcompression)) {
339
stcompression = rrdset_create_localhost(
340
"netdata"
341
, "compression_ratio"
@@ -329,7 +352,9 @@ void global_statistics_charts(void) {
352
);
353
354
rrddim_add(stcompression, "savings", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
332
- } else rrdset_next(stcompression);
355
+ }
356
+ else
357
+ rrdset_next(stcompression);
358
359
// since we don't lock here to read the global statistics
360
// read the smaller value first
src/ipc.c
+2
-4
@@ -191,8 +191,7 @@ int do_ipc(int update_every, usec_t dt) {
191
if(semaphores_max) rrdvar_custom_host_variable_set(semaphores_max, limits.semmns);
192
193
// create the charts
194
- semaphores = rrdset_find_localhost("system.ipc_semaphores");
195
- if(!semaphores) {
194
+ if(unlikely(!semaphores)) {
195
semaphores = rrdset_create_localhost(
196
"system"
197
, "ipc_semaphores"
@@ -210,8 +209,7 @@ int do_ipc(int update_every, usec_t dt) {
209
rrddim_add(semaphores, "semaphores", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
210
}
211
213
- arrays = rrdset_find_localhost("system.ipc_semaphore_arrays");
214
- if(!arrays) {
212
+ if(unlikely(!arrays)) {
213
arrays = rrdset_create_localhost(
214
"system"
215
, "ipc_semaphore_arrays"
src/macos_mach_smi.c
+2
-14
@@ -155,20 +155,8 @@ int do_macos_mach_smi(int update_every, usec_t dt) {
155
if (likely(do_swapio)) {
156
st = rrdset_find_localhost("system.swapio");
157
if (unlikely(!st)) {
158
- st = rrdset_create_localhost(
159
- "system"
160
- , "swapio"
161
- , NULL
162
- , "swap"
163
- , NULL
164
- , "Swap I/O"
165
- , "kilobytes/s"
166
- , "macos"
167
- , "mach_smi"
168
- , 250
169
- , update_every
170
- , RRDSET_TYPE_AREA
171
- );
158
+ st = rrdset_create_localhost("system", "swapio", NULL, "swap", NULL, "Swap I/O", "kilobytes/s", 250
159
+ , update_every, RRDSET_TYPE_AREA);
160
161
rrddim_add(st, "in", NULL, system_pagesize, 1024, RRD_ALGORITHM_INCREMENTAL);
162
rrddim_add(st, "out", NULL, -system_pagesize, 1024, RRD_ALGORITHM_INCREMENTAL);
src/plugin_proc_diskspace.c
+28
-32
@@ -395,22 +395,20 @@ void *proc_diskspace_main(void *ptr) {
395
getrusage(RUSAGE_THREAD, &thread);
396
397
if(!stcpu_thread) {
398
- stcpu_thread = rrdset_find_localhost("netdata.plugin_diskspace");
399
- if(!stcpu_thread)
400
- stcpu_thread = rrdset_create_localhost(
401
- "netdata"
402
- , "plugin_diskspace"
403
- , NULL
404
- , "diskspace"
405
- , NULL
406
- , "NetData Disk Space Plugin CPU usage"
407
- , "milliseconds/s"
408
- , "diskspace"
409
- , NULL
410
- , 132020
411
- , update_every
412
- , RRDSET_TYPE_STACKED
413
- );
398
+ stcpu_thread = rrdset_create_localhost(
399
+ "netdata"
400
+ , "plugin_diskspace"
401
+ , NULL
402
+ , "diskspace"
403
+ , NULL
404
+ , "NetData Disk Space Plugin CPU usage"
405
+ , "milliseconds/s"
406
+ , "diskspace"
407
+ , NULL
408
+ , 132020
409
+ , update_every
410
+ , RRDSET_TYPE_STACKED
411
+ );
412
413
rd_user = rrddim_add(stcpu_thread, "user", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL);
414
rd_system = rrddim_add(stcpu_thread, "system", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL);
@@ -425,22 +423,20 @@ void *proc_diskspace_main(void *ptr) {
423
// ----------------------------------------------------------------
424
425
if(!st_duration) {
428
- st_duration = rrdset_find_localhost("netdata.plugin_diskspace_dt");
429
- if(!st_duration)
430
- st_duration = rrdset_create_localhost(
431
- "netdata"
432
- , "plugin_diskspace_dt"
433
- , NULL
434
- , "diskspace"
435
- , NULL
436
- , "NetData Disk Space Plugin Duration"
437
- , "milliseconds/run"
438
- , "diskspace"
439
- , NULL
440
- , 132021
441
- , update_every
442
- , RRDSET_TYPE_AREA
443
- );
426
+ st_duration = rrdset_create_localhost(
427
+ "netdata"
428
+ , "plugin_diskspace_dt"
429
+ , NULL
430
+ , "diskspace"
431
+ , NULL
432
+ , "NetData Disk Space Plugin Duration"
433
+ , "milliseconds/run"
434
+ , "diskspace"
435
+ , NULL
436
+ , 132021
437
+ , update_every
438
+ , RRDSET_TYPE_AREA
439
+ );
440
441
rd_duration = rrddim_add(st_duration, "duration", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
442
}
src/plugin_tc.c
+13
-10
@@ -655,7 +655,7 @@ static inline void tc_device_set_device_name(struct tc_device *d, char *name) {
655
d->name = NULL;
656
}
657
658
- if(likely(name && *name && strcmp(d->id, name))) {
658
+ if(likely(name && *name && strcmp(d->id, name) == 0)) {
659
debug(D_TC_LOOP, "TC: Setting device '%s' name to '%s'", d->id, name);
660
d->name = strdupz(name);
661
d->name_updated = 1;
@@ -826,7 +826,6 @@ void *tc_main(void *ptr) {
826
error("Cannot set pthread cancel state to ENABLE.");
827
828
struct rusage thread;
829
- RRDSET *stcpu = NULL, *sttime = NULL;
829
830
char buffer[TC_LINE_MAX+1] = "";
831
char *words[PLUGINSD_MAX_WORDS] = { NULL };
@@ -1039,7 +1038,9 @@ void *tc_main(void *ptr) {
1038
// debug(D_TC_LOOP, "WORKTIME line '%s' '%s'", words[1], words[2]);
1039
getrusage(RUSAGE_THREAD, &thread);
1040
1042
- if(unlikely(!stcpu)) stcpu = rrdset_find_localhost("netdata.plugin_tc_cpu");
1041
+ RRDSET *stcpu = NULL;
1042
+ static RRDDIM *rd_user = NULL, *rd_system = NULL;
1043
+
1044
if(unlikely(!stcpu)) {
1045
stcpu = rrdset_create_localhost(
1046
"netdata"
@@ -1055,16 +1056,18 @@ void *tc_main(void *ptr) {
1056
, localhost->rrd_update_every
1057
, RRDSET_TYPE_STACKED
1058
);
1058
- rrddim_add(stcpu, "user", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL);
1059
- rrddim_add(stcpu, "system", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL);
1059
+ rd_user = rrddim_add(stcpu, "user", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL);
1060
+ rd_system = rrddim_add(stcpu, "system", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL);
1061
}
1062
else rrdset_next(stcpu);
1063
1063
- rrddim_set(stcpu, "user" , thread.ru_utime.tv_sec * 1000000ULL + thread.ru_utime.tv_usec);
1064
- rrddim_set(stcpu, "system", thread.ru_stime.tv_sec * 1000000ULL + thread.ru_stime.tv_usec);
1064
+ rrddim_set_by_pointer(stcpu, rd_user , thread.ru_utime.tv_sec * 1000000ULL + thread.ru_utime.tv_usec);
1065
+ rrddim_set_by_pointer(stcpu, rd_system, thread.ru_stime.tv_sec * 1000000ULL + thread.ru_stime.tv_usec);
1066
rrdset_done(stcpu);
1067
1067
- if(unlikely(!sttime)) sttime = rrdset_find_localhost("netdata.plugin_tc_time");
1068
+ RRDSET *sttime = NULL;
1069
+ static RRDDIM *rd_run_time = NULL;
1070
+
1071
if(unlikely(!sttime)) {
1072
sttime = rrdset_create_localhost(
1073
"netdata"
@@ -1080,11 +1083,11 @@ void *tc_main(void *ptr) {
1083
, localhost->rrd_update_every
1084
, RRDSET_TYPE_AREA
1085
);
1083
- rrddim_add(sttime, "run_time", "run time", 1, 1, RRD_ALGORITHM_ABSOLUTE);
1086
+ rd_run_time = rrddim_add(sttime, "run_time", "run time", 1, 1, RRD_ALGORITHM_ABSOLUTE);
1087
}
1088
else rrdset_next(sttime);
1089
1087
- rrddim_set(sttime, "run_time", atoll(words[1]));
1090
+ rrddim_set_by_pointer(sttime, rd_run_time, str2ll(words[1], NULL));
1091
rrdset_done(sttime);
1092
1093
}
src/proc_net_ip_vs_stats.c
+7
-7
@@ -35,13 +35,13 @@ int do_proc_net_ip_vs_stats(int update_every, usec_t dt) {
35
InBytes = strtoull(procfile_lineword(ff, 2, 3), NULL, 16);
36
OutBytes = strtoull(procfile_lineword(ff, 2, 4), NULL, 16);
37
38
- RRDSET *st;
38
39
// --------------------------------------------------------------------
40
41
if(do_sockets) {
43
- st = rrdset_find_localhost(RRD_TYPE_NET_IPVS ".sockets");
44
- if(!st) {
42
+ static RRDSET *st = NULL;
43
+
44
+ if(unlikely(!st)) {
45
st = rrdset_create_localhost(
46
RRD_TYPE_NET_IPVS
47
, "sockets"
@@ -68,8 +68,8 @@ int do_proc_net_ip_vs_stats(int update_every, usec_t dt) {
68
// --------------------------------------------------------------------
69
70
if(do_packets) {
71
- st = rrdset_find_localhost(RRD_TYPE_NET_IPVS ".packets");
72
- if(!st) {
71
+ static RRDSET *st = NULL;
72
+ if(unlikely(!st)) {
73
st = rrdset_create_localhost(
74
RRD_TYPE_NET_IPVS
75
, "packets"
@@ -98,8 +98,8 @@ int do_proc_net_ip_vs_stats(int update_every, usec_t dt) {
98
// --------------------------------------------------------------------
99
100
if(do_bandwidth) {
101
- st = rrdset_find_localhost(RRD_TYPE_NET_IPVS ".net");
102
- if(!st) {
101
+ static RRDSET *st = NULL;
102
+ if(unlikely(!st)) {
103
st = rrdset_create_localhost(
104
RRD_TYPE_NET_IPVS
105
, "net"
src/proc_net_snmp6.c
+22
-24
@@ -272,13 +272,11 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
272
procfile_lineword(ff, l, 1)))) break;
273
}
274
275
- RRDSET *st;
276
-
275
// --------------------------------------------------------------------
276
277
if(do_bandwidth == CONFIG_BOOLEAN_YES || (do_bandwidth == CONFIG_BOOLEAN_AUTO && (Ip6InOctets || Ip6OutOctets))) {
278
do_bandwidth = CONFIG_BOOLEAN_YES;
281
- st = rrdset_find_localhost("system.ipv6");
279
+ static RRDSET *st = NULL;
280
if(unlikely(!st)) {
281
st = rrdset_create_localhost(
282
"system"
@@ -309,7 +307,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
307
308
if(do_ip_packets == CONFIG_BOOLEAN_YES || (do_ip_packets == CONFIG_BOOLEAN_AUTO && (Ip6InReceives || Ip6OutRequests || Ip6InDelivers || Ip6OutForwDatagrams))) {
309
do_ip_packets = CONFIG_BOOLEAN_YES;
312
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".packets");
310
+ static RRDSET *st = NULL;
311
if(unlikely(!st)) {
312
st = rrdset_create_localhost(
313
RRD_TYPE_NET_SNMP6
@@ -344,7 +342,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
342
343
if(do_ip_fragsout == CONFIG_BOOLEAN_YES || (do_ip_fragsout == CONFIG_BOOLEAN_AUTO && (Ip6FragOKs || Ip6FragFails || Ip6FragCreates))) {
344
do_ip_fragsout = CONFIG_BOOLEAN_YES;
347
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".fragsout");
345
+ static RRDSET *st = NULL;
346
if(unlikely(!st)) {
347
st = rrdset_create_localhost(
348
RRD_TYPE_NET_SNMP6
@@ -384,7 +382,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
382
|| Ip6ReasmReqds
383
))) {
384
do_ip_fragsin = CONFIG_BOOLEAN_YES;
387
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".fragsin");
385
+ static RRDSET *st = NULL;
386
if(unlikely(!st)) {
387
st = rrdset_create_localhost(
388
RRD_TYPE_NET_SNMP6
@@ -429,7 +427,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
427
|| Ip6InNoRoutes
428
))) {
429
do_ip_errors = CONFIG_BOOLEAN_YES;
432
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".errors");
430
+ static RRDSET *st = NULL;
431
if(unlikely(!st)) {
432
st = rrdset_create_localhost(
433
RRD_TYPE_NET_SNMP6
@@ -479,7 +477,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
477
478
if(do_udp_packets == CONFIG_BOOLEAN_YES || (do_udp_packets == CONFIG_BOOLEAN_AUTO && (Udp6InDatagrams || Udp6OutDatagrams))) {
479
do_udp_packets = CONFIG_BOOLEAN_YES;
482
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".udppackets");
480
+ static RRDSET *st = NULL;
481
if(unlikely(!st)) {
482
st = rrdset_create_localhost(
483
RRD_TYPE_NET_SNMP6
@@ -518,7 +516,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
516
|| Udp6IgnoredMulti
517
))) {
518
do_udp_errors = CONFIG_BOOLEAN_YES;
521
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".udperrors");
519
+ static RRDSET *st = NULL;
520
if(unlikely(!st)) {
521
st = rrdset_create_localhost(
522
RRD_TYPE_NET_SNMP6
@@ -558,7 +556,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
556
557
if(do_udplite_packets == CONFIG_BOOLEAN_YES || (do_udplite_packets == CONFIG_BOOLEAN_AUTO && (UdpLite6InDatagrams || UdpLite6OutDatagrams))) {
558
do_udplite_packets = CONFIG_BOOLEAN_YES;
561
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".udplitepackets");
559
+ static RRDSET *st = NULL;
560
if(unlikely(!st)) {
561
st = rrdset_create_localhost(
562
RRD_TYPE_NET_SNMP6
@@ -597,7 +595,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
595
|| UdpLite6InCsumErrors
596
))) {
597
do_udplite_errors = CONFIG_BOOLEAN_YES;
600
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".udpliteerrors");
598
+ static RRDSET *st = NULL;
599
if(unlikely(!st)) {
600
st = rrdset_create_localhost(
601
RRD_TYPE_NET_SNMP6
@@ -635,7 +633,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
633
634
if(do_mcast == CONFIG_BOOLEAN_YES || (do_mcast == CONFIG_BOOLEAN_AUTO && (Ip6OutMcastOctets || Ip6InMcastOctets))) {
635
do_mcast = CONFIG_BOOLEAN_YES;
638
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".mcast");
636
+ static RRDSET *st = NULL;
637
if(unlikely(!st)) {
638
st = rrdset_create_localhost(
639
RRD_TYPE_NET_SNMP6
@@ -667,7 +665,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
665
666
if(do_bcast == CONFIG_BOOLEAN_YES || (do_bcast == CONFIG_BOOLEAN_AUTO && (Ip6OutBcastOctets || Ip6InBcastOctets))) {
667
do_bcast = CONFIG_BOOLEAN_YES;
670
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".bcast");
668
+ static RRDSET *st = NULL;
669
if(unlikely(!st)) {
670
st = rrdset_create_localhost(
671
RRD_TYPE_NET_SNMP6
@@ -699,7 +697,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
697
698
if(do_mcast_p == CONFIG_BOOLEAN_YES || (do_mcast_p == CONFIG_BOOLEAN_AUTO && (Ip6OutMcastPkts || Ip6InMcastPkts))) {
699
do_mcast_p = CONFIG_BOOLEAN_YES;
702
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".mcastpkts");
700
+ static RRDSET *st = NULL;
701
if(unlikely(!st)) {
702
st = rrdset_create_localhost(
703
RRD_TYPE_NET_SNMP6
@@ -731,7 +729,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
729
730
if(do_icmp == CONFIG_BOOLEAN_YES || (do_icmp == CONFIG_BOOLEAN_AUTO && (Icmp6InMsgs || Icmp6OutMsgs))) {
731
do_icmp = CONFIG_BOOLEAN_YES;
734
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmp");
732
+ static RRDSET *st = NULL;
733
if(unlikely(!st)) {
734
st = rrdset_create_localhost(
735
RRD_TYPE_NET_SNMP6
@@ -762,7 +760,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
760
761
if(do_icmp_redir == CONFIG_BOOLEAN_YES || (do_icmp_redir == CONFIG_BOOLEAN_AUTO && (Icmp6InRedirects || Icmp6OutRedirects))) {
762
do_icmp_redir = CONFIG_BOOLEAN_YES;
765
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmpredir");
763
+ static RRDSET *st = NULL;
764
if(unlikely(!st)) {
765
st = rrdset_create_localhost(
766
RRD_TYPE_NET_SNMP6
@@ -806,7 +804,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
804
|| Icmp6OutParmProblems
805
))) {
806
do_icmp_errors = CONFIG_BOOLEAN_YES;
809
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmperrors");
807
+ static RRDSET *st = NULL;
808
if(unlikely(!st)) {
809
st = rrdset_create_localhost(
810
RRD_TYPE_NET_SNMP6
@@ -862,7 +860,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
860
|| Icmp6OutEchoReplies
861
))) {
862
do_icmp_echos = CONFIG_BOOLEAN_YES;
865
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmpechos");
863
+ static RRDSET *st = NULL;
864
if(unlikely(!st)) {
865
st = rrdset_create_localhost(
866
RRD_TYPE_NET_SNMP6
@@ -905,7 +903,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
903
|| Icmp6OutGroupMembReductions
904
))) {
905
do_icmp_groupmemb = CONFIG_BOOLEAN_YES;
908
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".groupmemb");
906
+ static RRDSET *st = NULL;
907
if(unlikely(!st)) {
908
st = rrdset_create_localhost(
909
RRD_TYPE_NET_SNMP6
@@ -949,7 +947,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
947
|| Icmp6OutRouterAdvertisements
948
))) {
949
do_icmp_router = CONFIG_BOOLEAN_YES;
952
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmprouter");
950
+ static RRDSET *st = NULL;
951
if(unlikely(!st)) {
952
st = rrdset_create_localhost(
953
RRD_TYPE_NET_SNMP6
@@ -990,7 +988,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
988
|| Icmp6OutNeighborAdvertisements
989
))) {
990
do_icmp_neighbor = CONFIG_BOOLEAN_YES;
993
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmpneighbor");
991
+ static RRDSET *st = NULL;
992
if(unlikely(!st)) {
993
st = rrdset_create_localhost(
994
RRD_TYPE_NET_SNMP6
@@ -1025,7 +1023,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
1023
1024
if(do_icmp_mldv2 == CONFIG_BOOLEAN_YES || (do_icmp_mldv2 == CONFIG_BOOLEAN_AUTO && (Icmp6InMLDv2Reports || Icmp6OutMLDv2Reports))) {
1025
do_icmp_mldv2 = CONFIG_BOOLEAN_YES;
1028
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmpmldv2");
1026
+ static RRDSET *st = NULL;
1027
if(unlikely(!st)) {
1028
st = rrdset_create_localhost(
1029
RRD_TYPE_NET_SNMP6
@@ -1068,7 +1066,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
1066
|| Icmp6OutType143
1067
))) {
1068
do_icmp_types = CONFIG_BOOLEAN_YES;
1071
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmptypes");
1069
+ static RRDSET *st = NULL;
1070
if(unlikely(!st)) {
1071
st = rrdset_create_localhost(
1072
RRD_TYPE_NET_SNMP6
@@ -1121,7 +1119,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
1119
|| Ip6InCEPkts
1120
))) {
1121
do_ect = CONFIG_BOOLEAN_YES;
1124
- st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".ect");
1122
+ static RRDSET *st = NULL;
1123
if(unlikely(!st)) {
1124
st = rrdset_create_localhost(
1125
RRD_TYPE_NET_SNMP6
src/proc_net_stat_conntrack.c
+6
-8
@@ -125,12 +125,10 @@ int do_proc_net_stat_conntrack(int update_every, usec_t dt) {
125
rrdvar_custom_host_variable_set(rrdvar_max, max);
126
}
127
128
- RRDSET *st;
129
-
128
// --------------------------------------------------------------------
129
130
if(do_sockets) {
133
- st = rrdset_find_localhost(RRD_TYPE_NET_STAT_NETFILTER "." RRD_TYPE_NET_STAT_CONNTRACK "_sockets");
131
+ static RRDSET *st = NULL;
132
if(unlikely(!st)) {
133
st = rrdset_create_localhost(
134
RRD_TYPE_NET_STAT_NETFILTER
@@ -158,7 +156,7 @@ int do_proc_net_stat_conntrack(int update_every, usec_t dt) {
156
// --------------------------------------------------------------------
157
158
if(do_new) {
161
- st = rrdset_find_localhost(RRD_TYPE_NET_STAT_NETFILTER "." RRD_TYPE_NET_STAT_CONNTRACK "_new");
159
+ static RRDSET *st = NULL;
160
if(unlikely(!st)) {
161
st = rrdset_create_localhost(
162
RRD_TYPE_NET_STAT_NETFILTER
@@ -190,7 +188,7 @@ int do_proc_net_stat_conntrack(int update_every, usec_t dt) {
188
// --------------------------------------------------------------------
189
190
if(do_changes) {
193
- st = rrdset_find_localhost(RRD_TYPE_NET_STAT_NETFILTER "." RRD_TYPE_NET_STAT_CONNTRACK "_changes");
191
+ static RRDSET *st = NULL;
192
if(unlikely(!st)) {
193
st = rrdset_create_localhost(
194
RRD_TYPE_NET_STAT_NETFILTER
@@ -223,7 +221,7 @@ int do_proc_net_stat_conntrack(int update_every, usec_t dt) {
221
// --------------------------------------------------------------------
222
223
if(do_expect) {
226
- st = rrdset_find_localhost(RRD_TYPE_NET_STAT_NETFILTER "." RRD_TYPE_NET_STAT_CONNTRACK "_expect");
224
+ static RRDSET *st = NULL;
225
if(unlikely(!st)) {
226
st = rrdset_create_localhost(
227
RRD_TYPE_NET_STAT_NETFILTER
@@ -256,7 +254,7 @@ int do_proc_net_stat_conntrack(int update_every, usec_t dt) {
254
// --------------------------------------------------------------------
255
256
if(do_search) {
259
- st = rrdset_find_localhost(RRD_TYPE_NET_STAT_NETFILTER "." RRD_TYPE_NET_STAT_CONNTRACK "_search");
257
+ static RRDSET *st = NULL;
258
if(unlikely(!st)) {
259
st = rrdset_create_localhost(
260
RRD_TYPE_NET_STAT_NETFILTER
@@ -289,7 +287,7 @@ int do_proc_net_stat_conntrack(int update_every, usec_t dt) {
287
// --------------------------------------------------------------------
288
289
if(do_errors) {
292
- st = rrdset_find_localhost(RRD_TYPE_NET_STAT_NETFILTER "." RRD_TYPE_NET_STAT_CONNTRACK "_errors");
290
+ static RRDSET *st = NULL;
291
if(unlikely(!st)) {
292
st = rrdset_create_localhost(
293
RRD_TYPE_NET_STAT_NETFILTER
src/proc_net_stat_synproxy.c
+4
-6
@@ -53,14 +53,12 @@ int do_proc_net_stat_synproxy(int update_every, usec_t dt) {
53
54
unsigned long long events = entries + syn_received + cookie_invalid + cookie_valid + cookie_retrans + conn_reopened;
55
56
- RRDSET *st;
57
-
56
// --------------------------------------------------------------------
57
58
if((do_entries == CONFIG_BOOLEAN_AUTO && events) || do_entries == CONFIG_BOOLEAN_YES) {
59
do_entries = CONFIG_BOOLEAN_YES;
60
63
- st = rrdset_find_localhost(RRD_TYPE_NET_STAT_NETFILTER "." RRD_TYPE_NET_STAT_SYNPROXY "_entries");
61
+ static RRDSET *st = NULL;
62
if(unlikely(!st)) {
63
st = rrdset_create_localhost(
64
RRD_TYPE_NET_STAT_NETFILTER
@@ -90,7 +88,7 @@ int do_proc_net_stat_synproxy(int update_every, usec_t dt) {
88
if((do_syns == CONFIG_BOOLEAN_AUTO && events) || do_syns == CONFIG_BOOLEAN_YES) {
89
do_syns = CONFIG_BOOLEAN_YES;
90
93
- st = rrdset_find_localhost(RRD_TYPE_NET_STAT_NETFILTER "." RRD_TYPE_NET_STAT_SYNPROXY "_syn_received");
91
+ static RRDSET *st = NULL;
92
if(unlikely(!st)) {
93
st = rrdset_create_localhost(
94
RRD_TYPE_NET_STAT_NETFILTER
@@ -120,7 +118,7 @@ int do_proc_net_stat_synproxy(int update_every, usec_t dt) {
118
if((do_reopened == CONFIG_BOOLEAN_AUTO && events) || do_reopened == CONFIG_BOOLEAN_YES) {
119
do_reopened = CONFIG_BOOLEAN_YES;
120
123
- st = rrdset_find_localhost(RRD_TYPE_NET_STAT_NETFILTER "." RRD_TYPE_NET_STAT_SYNPROXY "_conn_reopened");
121
+ static RRDSET *st = NULL;
122
if(unlikely(!st)) {
123
st = rrdset_create_localhost(
124
RRD_TYPE_NET_STAT_NETFILTER
@@ -150,7 +148,7 @@ int do_proc_net_stat_synproxy(int update_every, usec_t dt) {
148
if((do_cookies == CONFIG_BOOLEAN_AUTO && events) || do_cookies == CONFIG_BOOLEAN_YES) {
149
do_cookies = CONFIG_BOOLEAN_YES;
150
153
- st = rrdset_find_localhost(RRD_TYPE_NET_STAT_NETFILTER "." RRD_TYPE_NET_STAT_SYNPROXY "_cookies");
151
+ static RRDSET *st = NULL;
152
if(unlikely(!st)) {
153
st = rrdset_create_localhost(
154
RRD_TYPE_NET_STAT_NETFILTER
src/registry.c
+3
-6
@@ -323,8 +323,7 @@ void registry_statistics(void) {
323
324
static RRDSET *sts = NULL, *stc = NULL, *stm = NULL;
325
326
- if(!sts) sts = rrdset_find_localhost("netdata.registry_sessions");
327
- if(!sts) {
326
+ if(unlikely(!sts)) {
327
sts = rrdset_create_localhost(
328
"netdata"
329
, "registry_sessions"
@@ -349,8 +348,7 @@ void registry_statistics(void) {
348
349
// ------------------------------------------------------------------------
350
352
- if(!stc) stc = rrdset_find_localhost("netdata.registry_entries");
353
- if(!stc) {
351
+ if(unlikely(!stc)) {
352
stc = rrdset_create_localhost(
353
"netdata"
354
, "registry_entries"
@@ -383,8 +381,7 @@ void registry_statistics(void) {
381
382
// ------------------------------------------------------------------------
383
386
- if(!stm) stm = rrdset_find_localhost("netdata.registry_mem");
387
- if(!stm) {
384
+ if(unlikely(!stm)) {
385
stm = rrdset_create_localhost(
386
"netdata"
387
, "registry_mem"