summaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2022-09-07 15:28:30 +0300
committerGitHub <noreply@github.com>2022-09-07 15:28:30 +0300
commit3f6a75250d8251b0142248ed2f33f7d857ee21c8 (patch)
treef8fd7544a2fb509b295e6bd5267baab6014bc787 /collectors
parent17e0676b5bb6b11ad9aec705ade05163dcc2de31 (diff)
Obsolete RRDSET state (#13635)
* move chart_labels to rrdset * rename chart_labels to rrdlabels * renamed hash_id to uuid * turned is_ar_chart into an rrdset flag * removed rrdset state * removed unused senders_connected member of rrdhost * removed unused host flag RRDHOST_FLAG_MULTIHOST * renamed rrdhost host_labels to rrdlabels * Update exporting unit tests Co-authored-by: Vladimir Kobal <vlad@prokk.net>
Diffstat (limited to 'collectors')
-rw-r--r--collectors/plugins.d/pluginsd_parser.c6
-rw-r--r--collectors/proc.plugin/proc_diskstats.c12
-rw-r--r--collectors/proc.plugin/proc_interrupts.c2
-rw-r--r--collectors/proc.plugin/proc_mdstat.c4
-rw-r--r--collectors/proc.plugin/proc_net_wireless.c2
-rw-r--r--collectors/proc.plugin/proc_pagetypeinfo.c6
-rw-r--r--collectors/proc.plugin/proc_softirqs.c2
-rw-r--r--collectors/proc.plugin/proc_stat.c2
-rw-r--r--collectors/proc.plugin/sys_block_zram.c8
-rw-r--r--collectors/proc.plugin/sys_class_power_supply.c2
-rw-r--r--collectors/proc.plugin/sys_devices_system_node.c2
-rw-r--r--collectors/proc.plugin/sys_fs_btrfs.c4
12 files changed, 26 insertions, 26 deletions
diff --git a/collectors/plugins.d/pluginsd_parser.c b/collectors/plugins.d/pluginsd_parser.c
index 3f0a5ae8bb..3dffde5acc 100644
--- a/collectors/plugins.d/pluginsd_parser.c
+++ b/collectors/plugins.d/pluginsd_parser.c
@@ -197,10 +197,10 @@ PARSER_RC pluginsd_overwrite_action(void *user, RRDHOST *host, DICTIONARY *new_h
{
UNUSED(user);
- if(!host->host_labels)
- host->host_labels = rrdlabels_create();
+ if(!host->rrdlabels)
+ host->rrdlabels = rrdlabels_create();
- rrdlabels_migrate_to_these(host->host_labels, new_host_labels);
+ rrdlabels_migrate_to_these(host->rrdlabels, new_host_labels);
sql_store_host_labels(host);
return PARSER_RC_OK;
diff --git a/collectors/proc.plugin/proc_diskstats.c b/collectors/proc.plugin/proc_diskstats.c
index 4c2dcdb330..945ca25216 100644
--- a/collectors/proc.plugin/proc_diskstats.c
+++ b/collectors/proc.plugin/proc_diskstats.c
@@ -853,25 +853,25 @@ static struct disk *get_disk(unsigned long major, unsigned long minor, char *dis
}
static void add_labels_to_disk(struct disk *d, RRDSET *st) {
- rrdlabels_add(st->state->chart_labels, "device", d->disk, RRDLABEL_SRC_AUTO);
- rrdlabels_add(st->state->chart_labels, "mount_point", d->mount_point, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device", d->disk, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "mount_point", d->mount_point, RRDLABEL_SRC_AUTO);
switch (d->type) {
default:
case DISK_TYPE_UNKNOWN:
- rrdlabels_add(st->state->chart_labels, "device_type", "unknown", RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device_type", "unknown", RRDLABEL_SRC_AUTO);
break;
case DISK_TYPE_PHYSICAL:
- rrdlabels_add(st->state->chart_labels, "device_type", "physical", RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device_type", "physical", RRDLABEL_SRC_AUTO);
break;
case DISK_TYPE_PARTITION:
- rrdlabels_add(st->state->chart_labels, "device_type", "partition", RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device_type", "partition", RRDLABEL_SRC_AUTO);
break;
case DISK_TYPE_VIRTUAL:
- rrdlabels_add(st->state->chart_labels, "device_type", "virtual", RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device_type", "virtual", RRDLABEL_SRC_AUTO);
break;
}
diff --git a/collectors/proc.plugin/proc_interrupts.c b/collectors/proc.plugin/proc_interrupts.c
index 804fab88a5..db2a20b5df 100644
--- a/collectors/proc.plugin/proc_interrupts.c
+++ b/collectors/proc.plugin/proc_interrupts.c
@@ -228,7 +228,7 @@ int do_proc_interrupts(int update_every, usec_t dt) {
char core[50+1];
snprintfz(core, 50, "cpu%d", c);
- rrdlabels_add(core_st[c]->state->chart_labels, "cpu", core, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(core_st[c]->rrdlabels, "cpu", core, RRDLABEL_SRC_AUTO);
}
else rrdset_next(core_st[c]);
diff --git a/collectors/proc.plugin/proc_mdstat.c b/collectors/proc.plugin/proc_mdstat.c
index c50c462adc..77b75d3139 100644
--- a/collectors/proc.plugin/proc_mdstat.c
+++ b/collectors/proc.plugin/proc_mdstat.c
@@ -78,8 +78,8 @@ static inline void make_chart_obsolete(char *name, const char *id_modifier)
}
static void add_labels_to_mdstat(struct raid *raid, RRDSET *st) {
- rrdlabels_add(st->state->chart_labels, "device", raid->name, RRDLABEL_SRC_AUTO);
- rrdlabels_add(st->state->chart_labels, "raid_level", raid->level, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device", raid->name, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "raid_level", raid->level, RRDLABEL_SRC_AUTO);
rrdcalc_update_rrdlabels(st);
}
diff --git a/collectors/proc.plugin/proc_net_wireless.c b/collectors/proc.plugin/proc_net_wireless.c
index dac8344895..328ab1ca05 100644
--- a/collectors/proc.plugin/proc_net_wireless.c
+++ b/collectors/proc.plugin/proc_net_wireless.c
@@ -199,7 +199,7 @@ static void configure_device(int do_status, int do_quality, int do_discarded_pac
}
static void add_labels_to_wireless(struct netwireless *w, RRDSET *st) {
- rrdlabels_add(st->state->chart_labels, "device", w->name, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device", w->name, RRDLABEL_SRC_AUTO);
rrdcalc_update_rrdlabels(st);
}
diff --git a/collectors/proc.plugin/proc_pagetypeinfo.c b/collectors/proc.plugin/proc_pagetypeinfo.c
index 017edc49a9..c4957cafa2 100644
--- a/collectors/proc.plugin/proc_pagetypeinfo.c
+++ b/collectors/proc.plugin/proc_pagetypeinfo.c
@@ -261,9 +261,9 @@ int do_proc_pagetypeinfo(int update_every, usec_t dt) {
char node[50+1];
snprintfz(node, 50, "node%d", pgl->node);
- rrdlabels_add(st_nodezonetype[p]->state->chart_labels, "node_id", node, RRDLABEL_SRC_AUTO);
- rrdlabels_add(st_nodezonetype[p]->state->chart_labels, "node_zone", pgl->zone, RRDLABEL_SRC_AUTO);
- rrdlabels_add(st_nodezonetype[p]->state->chart_labels, "node_type", pgl->type, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st_nodezonetype[p]->rrdlabels, "node_id", node, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st_nodezonetype[p]->rrdlabels, "node_zone", pgl->zone, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st_nodezonetype[p]->rrdlabels, "node_type", pgl->type, RRDLABEL_SRC_AUTO);
for (o = 0; o < pageorders_cnt; o++) {
char dimid[3+1];
diff --git a/collectors/proc.plugin/proc_softirqs.c b/collectors/proc.plugin/proc_softirqs.c
index feefa98855..d6389161a2 100644
--- a/collectors/proc.plugin/proc_softirqs.c
+++ b/collectors/proc.plugin/proc_softirqs.c
@@ -220,7 +220,7 @@ int do_proc_softirqs(int update_every, usec_t dt) {
char core[50+1];
snprintfz(core, 50, "cpu%d", c);
- rrdlabels_add(core_st[c]->state->chart_labels, "cpu", core, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(core_st[c]->rrdlabels, "cpu", core, RRDLABEL_SRC_AUTO);
}
else
rrdset_next(core_st[c]);
diff --git a/collectors/proc.plugin/proc_stat.c b/collectors/proc.plugin/proc_stat.c
index 6faba55a91..5086ff2c7d 100644
--- a/collectors/proc.plugin/proc_stat.c
+++ b/collectors/proc.plugin/proc_stat.c
@@ -1041,7 +1041,7 @@ int do_proc_stat(int update_every, usec_t dt) {
char corebuf[50+1];
snprintfz(corebuf, 50, "cpu%zu", core);
- rrdlabels_add(cpuidle_charts[core].st->state->chart_labels, "cpu", corebuf, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(cpuidle_charts[core].st->rrdlabels, "cpu", corebuf, RRDLABEL_SRC_AUTO);
char cpuidle_dim_id[RRD_ID_LENGTH_MAX + 1];
cpuidle_charts[core].active_time_rd = rrddim_add(cpuidle_charts[core].st, "active", "C0 (active)", 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL);
diff --git a/collectors/proc.plugin/sys_block_zram.c b/collectors/proc.plugin/sys_block_zram.c
index ddd1e7ae01..42c467630c 100644
--- a/collectors/proc.plugin/sys_block_zram.c
+++ b/collectors/proc.plugin/sys_block_zram.c
@@ -75,7 +75,7 @@ static inline void init_rrd(const char *name, ZRAM_DEVICE *d, int update_every)
, RRDSET_TYPE_AREA);
d->rd_compr_data_size = rrddim_add(d->st_usage, "compressed", NULL, 1, 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
d->rd_metadata_size = rrddim_add(d->st_usage, "metadata", NULL, 1, 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
- rrdlabels_add(d->st_usage->state->chart_labels, "device", name, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_usage->rrdlabels, "device", name, RRDLABEL_SRC_AUTO);
snprintfz(chart_name, RRD_ID_LENGTH_MAX, "zram_savings.%s", name);
d->st_savings = rrdset_create_localhost(
@@ -93,7 +93,7 @@ static inline void init_rrd(const char *name, ZRAM_DEVICE *d, int update_every)
, RRDSET_TYPE_AREA);
d->rd_savings_size = rrddim_add(d->st_savings, "savings", NULL, 1, 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
d->rd_original_size = rrddim_add(d->st_savings, "original", NULL, 1, 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
- rrdlabels_add(d->st_savings->state->chart_labels, "device", name, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_savings->rrdlabels, "device", name, RRDLABEL_SRC_AUTO);
snprintfz(chart_name, RRD_ID_LENGTH_MAX, "zram_ratio.%s", name);
d->st_comp_ratio = rrdset_create_localhost(
@@ -110,7 +110,7 @@ static inline void init_rrd(const char *name, ZRAM_DEVICE *d, int update_every)
, update_every
, RRDSET_TYPE_LINE);
d->rd_comp_ratio = rrddim_add(d->st_comp_ratio, "ratio", NULL, 1, 100, RRD_ALGORITHM_ABSOLUTE);
- rrdlabels_add(d->st_comp_ratio->state->chart_labels, "device", name, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_comp_ratio->rrdlabels, "device", name, RRDLABEL_SRC_AUTO);
snprintfz(chart_name, RRD_ID_LENGTH_MAX, "zram_efficiency.%s", name);
d->st_alloc_efficiency = rrdset_create_localhost(
@@ -127,7 +127,7 @@ static inline void init_rrd(const char *name, ZRAM_DEVICE *d, int update_every)
, update_every
, RRDSET_TYPE_LINE);
d->rd_alloc_efficiency = rrddim_add(d->st_alloc_efficiency, "percent", NULL, 1, 10000, RRD_ALGORITHM_ABSOLUTE);
- rrdlabels_add(d->st_alloc_efficiency->state->chart_labels, "device", name, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_alloc_efficiency->rrdlabels, "device", name, RRDLABEL_SRC_AUTO);
}
static int init_devices(DICTIONARY *devices, unsigned int zram_id, int update_every) {
diff --git a/collectors/proc.plugin/sys_class_power_supply.c b/collectors/proc.plugin/sys_class_power_supply.c
index e8a7924b09..40731b5d5f 100644
--- a/collectors/proc.plugin/sys_class_power_supply.c
+++ b/collectors/proc.plugin/sys_class_power_supply.c
@@ -113,7 +113,7 @@ void power_supply_free(struct power_supply *ps) {
}
static void add_labels_to_power_supply(struct power_supply *ps, RRDSET *st) {
- rrdlabels_add(st->state->chart_labels, "device", ps->name, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device", ps->name, RRDLABEL_SRC_AUTO);
rrdcalc_update_rrdlabels(st);
}
diff --git a/collectors/proc.plugin/sys_devices_system_node.c b/collectors/proc.plugin/sys_devices_system_node.c
index fd33943097..72362a987f 100644
--- a/collectors/proc.plugin/sys_devices_system_node.c
+++ b/collectors/proc.plugin/sys_devices_system_node.c
@@ -115,7 +115,7 @@ int do_proc_sys_devices_system_node(int update_every, usec_t dt) {
, RRDSET_TYPE_LINE
);
- rrdlabels_add(m->numastat_st->state->chart_labels, "numa_node", m->name, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(m->numastat_st->rrdlabels, "numa_node", m->name, RRDLABEL_SRC_AUTO);
rrdset_flag_set(m->numastat_st, RRDSET_FLAG_DETAIL);
diff --git a/collectors/proc.plugin/sys_fs_btrfs.c b/collectors/proc.plugin/sys_fs_btrfs.c
index 83a2dee376..323bb69671 100644
--- a/collectors/proc.plugin/sys_fs_btrfs.c
+++ b/collectors/proc.plugin/sys_fs_btrfs.c
@@ -449,8 +449,8 @@ static inline int find_all_btrfs_pools(const char *path) {
}
static void add_labels_to_btrfs(BTRFS_NODE *n, RRDSET *st) {
- rrdlabels_add(st->state->chart_labels, "device", n->id, RRDLABEL_SRC_AUTO);
- rrdlabels_add(st->state->chart_labels, "device_label", n->label, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device", n->id, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(st->rrdlabels, "device_label", n->label, RRDLABEL_SRC_AUTO);
rrdcalc_update_rrdlabels(st);
}