diff options
author | vkalintiris <vasilis@netdata.cloud> | 2022-11-22 04:52:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-22 04:52:15 +0200 |
commit | 2d5f3acf71f0c759056a3269987fee484566bc4c (patch) | |
tree | 5246e1080ea721ba84e5f749f8d8e98d978d81c8 /collectors/proc.plugin/proc_net_rpc_nfsd.c | |
parent | 147552807bc19af949fe3cb315c4743dadfa7f0b (diff) |
Do not force internal collectors to call rrdset_next. (#13926)
* Remove calls to rrdset_next().
* Rm checks plugin
* Update documentantion
* Call rrdset_next from within rrdset_done
This wraps up the removal of rrdset_next from internal collectors, which
removes a lot of unecessary code and the need for if/else clauses in
every place.
The pluginsd parser is the only component that calls rrdset_next*()
functions because it's not strictly speaking a collector but more of a
collector manager/proxy.
With the current changes it's possible to simplify the API we expose
from RRD significantly, but this will be follow-up work in the future.
* Remove stale reference to checks.plugin
* Fix RRD unit test
rrdset_next is not meant to be called from these tests.
* Fix db engine unit test.
* Schedule rrdset_next when we have completed at least one collection.
* Mark chart creation clauses as unlikely.
* Add missing brace to fix FreeBSD plugin.
Diffstat (limited to 'collectors/proc.plugin/proc_net_rpc_nfsd.c')
-rw-r--r-- | collectors/proc.plugin/proc_net_rpc_nfsd.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/collectors/proc.plugin/proc_net_rpc_nfsd.c b/collectors/proc.plugin/proc_net_rpc_nfsd.c index 6022eb1490..bd1da8889a 100644 --- a/collectors/proc.plugin/proc_net_rpc_nfsd.c +++ b/collectors/proc.plugin/proc_net_rpc_nfsd.c @@ -449,8 +449,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { } } - // -------------------------------------------------------------------- - if(do_rc == 2) { static RRDSET *st = NULL; static RRDDIM *rd_hits = NULL, @@ -477,7 +475,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { rd_misses = rrddim_add(st, "misses", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); rd_nocache = rrddim_add(st, "nocache", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); } - else rrdset_next(st); rrddim_set_by_pointer(st, rd_hits, rc_hits); rrddim_set_by_pointer(st, rd_misses, rc_misses); @@ -485,8 +482,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { rrdset_done(st); } - // -------------------------------------------------------------------- - if(do_fh == 2) { static RRDSET *st = NULL; static RRDDIM *rd_stale = NULL; @@ -510,14 +505,11 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { rd_stale = rrddim_add(st, "stale", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); } - else rrdset_next(st); rrddim_set_by_pointer(st, rd_stale, fh_stale); rrdset_done(st); } - // -------------------------------------------------------------------- - if(do_io == 2) { static RRDSET *st = NULL; static RRDDIM *rd_read = NULL, @@ -542,15 +534,12 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { rd_read = rrddim_add(st, "read", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL); rd_write = rrddim_add(st, "write", NULL, -1, 1000, RRD_ALGORITHM_INCREMENTAL); } - else rrdset_next(st); rrddim_set_by_pointer(st, rd_read, io_read); rrddim_set_by_pointer(st, rd_write, io_write); rrdset_done(st); } - // -------------------------------------------------------------------- - if(do_th == 2) { static RRDSET *st = NULL; static RRDDIM *rd_threads = NULL; @@ -573,15 +562,11 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { rd_threads = rrddim_add(st, "threads", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); } - else rrdset_next(st); rrddim_set_by_pointer(st, rd_threads, th_threads); rrdset_done(st); - } - // -------------------------------------------------------------------- - if(do_net == 2) { static RRDSET *st = NULL; static RRDDIM *rd_udp = NULL, @@ -607,7 +592,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { rd_udp = rrddim_add(st, "udp", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); rd_tcp = rrddim_add(st, "tcp", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); } - else rrdset_next(st); // ignore net_count, net_tcp_connections (void)net_count; @@ -618,8 +602,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { rrdset_done(st); } - // -------------------------------------------------------------------- - if(do_rpc == 2) { static RRDSET *st = NULL; static RRDDIM *rd_calls = NULL, @@ -647,7 +629,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { rd_bad_format = rrddim_add(st, "bad_format", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL); rd_bad_auth = rrddim_add(st, "bad_auth", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL); } - else rrdset_next(st); // ignore rpc_bad_client (void)rpc_bad_client; @@ -658,8 +639,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { rrdset_done(st); } - // -------------------------------------------------------------------- - if(do_proc2 == 2) { static RRDSET *st = NULL; if(unlikely(!st)) { @@ -678,7 +657,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { , RRDSET_TYPE_STACKED ); } - else rrdset_next(st); size_t i; for(i = 0; nfsd_proc2_values[i].present ; i++) { @@ -691,8 +669,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { rrdset_done(st); } - // -------------------------------------------------------------------- - if(do_proc3 == 2) { static RRDSET *st = NULL; if(unlikely(!st)) { @@ -711,7 +687,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { , RRDSET_TYPE_STACKED ); } - else rrdset_next(st); size_t i; for(i = 0; nfsd_proc3_values[i].present ; i++) { @@ -724,8 +699,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { rrdset_done(st); } - // -------------------------------------------------------------------- - if(do_proc4 == 2) { static RRDSET *st = NULL; if(unlikely(!st)) { @@ -744,7 +717,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { , RRDSET_TYPE_STACKED ); } - else rrdset_next(st); size_t i; for(i = 0; nfsd_proc4_values[i].present ; i++) { @@ -757,8 +729,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { rrdset_done(st); } - // -------------------------------------------------------------------- - if(do_proc4ops == 2) { static RRDSET *st = NULL; if(unlikely(!st)) { @@ -777,7 +747,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) { , RRDSET_TYPE_STACKED ); } - else rrdset_next(st); size_t i; for(i = 0; nfsd4_ops_values[i].present ; i++) { |