@cryptotaxi247 / netdata-1 / commits / e910ccc6c

DBENGINE: use gorilla by default (#17234)

* use gorilla by default * allow switching back from gorilla; increase unittest stress

Costa Tsaousis committed Mar 23, 2024 at 16:51 UTC e910ccc6c9ff7a33b2a39f5e16c8aae9712b7ee0
3 files changed +14 -6
src/daemon/main.c
+11 -3
@@ -1169,10 +1169,13 @@ static void get_netdata_configured_variables() {
1169 // ------------------------------------------------------------------------
1170 // get default Database Engine page type
1171
1172 - const char *page_type = config_get(CONFIG_SECTION_DB, "dbengine page type", "raw");
1173 - if (strcmp(page_type, "gorilla") == 0) {
1172 + const char *page_type = config_get(CONFIG_SECTION_DB, "dbengine page type", "gorilla");
1173 + if (strcmp(page_type, "gorilla") == 0)
1174 tier_page_type[0] = PAGE_GORILLA_METRICS;
1175 - } else if (strcmp(page_type, "raw") != 0) {
1175 + else if (strcmp(page_type, "raw") == 0)
1176 + tier_page_type[0] = PAGE_METRICS;
1177 + else {
1178 + tier_page_type[0] = PAGE_METRICS;
1179 netdata_log_error("Invalid dbengine page type ''%s' given. Defaulting to 'raw'.", page_type);
1180 }
1181
@@ -1521,6 +1524,11 @@ int main(int argc, char **argv) {
1524
1525 if(strcmp(optarg, "unittest") == 0) {
1526 unittest_running = true;
1527 +
1528 + // set defaults for dbegnine unittest
1529 + config_set(CONFIG_SECTION_DB, "dbengine page type", "gorilla");
1530 + default_rrdeng_disk_quota_mb = default_multidb_disk_quota_mb = 256;
1531 +
1532 if (sqlite_library_init())
1533 return 1;
1534
src/database/engine/dbengine-unittest.c
+2 -2
@@ -5,9 +5,9 @@
5 #ifdef ENABLE_DBENGINE
6
7 #define CHARTS 64
8 -#define DIMS 8 // CHARTS * DIMS dimensions
8 +#define DIMS 16 // CHARTS * DIMS dimensions
9 #define REGIONS 11
10 -#define POINTS_PER_REGION 4096
10 +#define POINTS_PER_REGION 16384
11 static const int REGION_UPDATE_EVERY[REGIONS] = {1, 15, 3, 20, 2, 6, 30, 12, 5, 4, 10};
12
13 #define START_TIMESTAMP MAX(2 * API_RELATIVE_TIME_MAX, 200000000)
src/database/engine/rrdengineapi.c
+1 -1
@@ -16,7 +16,7 @@ struct rrdengine_instance multidb_ctx_storage_tier4;
16 #error RRD_STORAGE_TIERS is not 5 - you need to add allocations here
17 #endif
18 struct rrdengine_instance *multidb_ctx[RRD_STORAGE_TIERS];
19 -uint8_t tier_page_type[RRD_STORAGE_TIERS] = {PAGE_METRICS, PAGE_TIER, PAGE_TIER, PAGE_TIER, PAGE_TIER};
19 +uint8_t tier_page_type[RRD_STORAGE_TIERS] = {PAGE_GORILLA_METRICS, PAGE_TIER, PAGE_TIER, PAGE_TIER, PAGE_TIER};
20
21 #if defined(ENV32BIT)
22 size_t tier_page_size[RRD_STORAGE_TIERS] = {2048, 1024, 192, 192, 192};