summaryrefslogtreecommitdiffstats
path: root/collectors/tc.plugin
diff options
context:
space:
mode:
authorvkalintiris <vasilis@netdata.cloud>2022-11-22 04:52:15 +0200
committerGitHub <noreply@github.com>2022-11-22 04:52:15 +0200
commit2d5f3acf71f0c759056a3269987fee484566bc4c (patch)
tree5246e1080ea721ba84e5f749f8d8e98d978d81c8 /collectors/tc.plugin
parent147552807bc19af949fe3cb315c4743dadfa7f0b (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/tc.plugin')
-rw-r--r--collectors/tc.plugin/plugin_tc.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/collectors/tc.plugin/plugin_tc.c b/collectors/tc.plugin/plugin_tc.c
index e256249202..a2e72ee339 100644
--- a/collectors/tc.plugin/plugin_tc.c
+++ b/collectors/tc.plugin/plugin_tc.c
@@ -421,7 +421,6 @@ static inline void tc_device_commit(struct tc_device *d) {
rrdlabels_add(d->st_bytes->rrdlabels, "family", string2str(d->family?d->family:d->id), RRDLABEL_SRC_AUTO);
}
else {
- rrdset_next(d->st_bytes);
if(unlikely(d->name_updated))
rrdset_reset_name(d->st_bytes, string2str(d->name));
@@ -483,8 +482,6 @@ static inline void tc_device_commit(struct tc_device *d) {
rrdlabels_add(d->st_bytes->rrdlabels, "family", string2str(d->family?d->family:d->id), RRDLABEL_SRC_AUTO);
}
else {
- rrdset_next(d->st_packets);
-
if(unlikely(d->name_updated)) {
char name[RRD_ID_LENGTH_MAX + 1];
snprintfz(name, RRD_ID_LENGTH_MAX, "%s_packets", string2str(d->name?d->name:d->id));
@@ -549,8 +546,6 @@ static inline void tc_device_commit(struct tc_device *d) {
rrdlabels_add(d->st_bytes->rrdlabels, "family", string2str(d->family?d->family:d->id), RRDLABEL_SRC_AUTO);
}
else {
- rrdset_next(d->st_dropped);
-
if(unlikely(d->name_updated)) {
char name[RRD_ID_LENGTH_MAX + 1];
snprintfz(name, RRD_ID_LENGTH_MAX, "%s_dropped", string2str(d->name?d->name:d->id));
@@ -615,8 +610,6 @@ static inline void tc_device_commit(struct tc_device *d) {
rrdlabels_add(d->st_bytes->rrdlabels, "family", string2str(d->family?d->family:d->id), RRDLABEL_SRC_AUTO);
}
else {
- rrdset_next(d->st_tokens);
-
if(unlikely(d->name_updated)) {
char name[RRD_ID_LENGTH_MAX + 1];
snprintfz(name, RRD_ID_LENGTH_MAX, "%s_tokens", string2str(d->name?d->name:d->id));
@@ -683,7 +676,6 @@ static inline void tc_device_commit(struct tc_device *d) {
}
else {
debug(D_TC_LOOP, "TC: Updating _ctokens chart for device '%s'", string2str(d->name?d->name:d->id));
- rrdset_next(d->st_ctokens);
if(unlikely(d->name_updated)) {
char name[RRD_ID_LENGTH_MAX + 1];