Minor code adjustments (#20290)
nd_profile contains the configured tiers
Stelios Fragkakis committed
May 16, 2025 at 23:33 UTC
7bd5557e3bdc2657d7f5452256da902bdcc16120
2 files changed
+2
-5
src/database/rrd-retention.c
+1
-1
@@ -37,7 +37,7 @@ RRDSTATS_RETENTION rrdstats_retention_collect(void) {
37
retention.storage_tiers = nd_profile.storage_tiers;
38
39
// Iterate through all available storage tiers
40
- for(size_t tier = 0; tier < retention.storage_tiers && tier < RRD_MAX_STORAGE_TIERS; tier++) {
40
+ for(size_t tier = 0; tier < retention.storage_tiers; tier++) {
41
STORAGE_ENGINE *eng = localhost->db[tier].eng;
42
if(!eng)
43
continue;
src/database/rrd-retention.h
+1
-4
@@ -6,9 +6,6 @@
6
#include "libnetdata/libnetdata.h"
7
#include "storage-engine.h"
8
9
-// Maximum number of storage tiers the system supports
10
-#define RRD_MAX_STORAGE_TIERS 32
11
-
9
// Structure to hold information about each storage tier
10
typedef struct rrd_storage_tier {
11
size_t tier; // Tier number
@@ -38,7 +35,7 @@ typedef struct rrd_storage_tier {
35
// Main structure to hold retention information across all tiers
36
typedef struct rrdstats_retention {
37
size_t storage_tiers; // Number of available storage tiers
41
- RRD_STORAGE_TIER tiers[RRD_MAX_STORAGE_TIERS]; // Array of tier information
38
+ RRD_STORAGE_TIER tiers[RRD_STORAGE_TIERS]; // Array of tier information
39
} RRDSTATS_RETENTION;
40
41
// Function to collect retention statistics