summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2023-01-14 00:09:02 +0200
committerGitHub <noreply@github.com>2023-01-14 00:09:02 +0200
commitf10f19c8c8bba37e8364fa6138d6ea0f6160c3ea (patch)
tree6d71bc40d56362dd4de892239a633bdcfa2183be /web
parent3e2924fd466dbc05338518412f426d34b215ef0b (diff)
More 32bit fixes (#14264)
* query planer weight calculation using long long * adjust replication query ahead pipeline for smaller systems * do not generate huge replication messages * add message to indicate replication message was interrupted * improved message * max replication size 25% of sender buffer * fix for last commit * use less cache and smaller page sizes and fewer threads on 32-bits * fix reserved libuv workers for 32bits * fix detection of 32/64 bit
Diffstat (limited to 'web')
-rw-r--r--web/api/queries/query.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/web/api/queries/query.c b/web/api/queries/query.c
index a434e5f64c..872868fd3f 100644
--- a/web/api/queries/query.c
+++ b/web/api/queries/query.c
@@ -726,15 +726,15 @@ static long query_plan_points_coverage_weight(time_t db_first_time_s, time_t db_
db_last_time_s < after_wanted)
return -LONG_MAX;
- time_t common_first_t = MAX(db_first_time_s, after_wanted);
- time_t common_last_t = MIN(db_last_time_s, before_wanted);
+ long long common_first_t = MAX(db_first_time_s, after_wanted);
+ long long common_last_t = MIN(db_last_time_s, before_wanted);
- long time_coverage = (common_last_t - common_first_t) * 1000000 / (before_wanted - after_wanted);
- size_t points_wanted_in_coverage = points_wanted * time_coverage / 1000000;
+ long long time_coverage = (common_last_t - common_first_t) * 1000000LL / (before_wanted - after_wanted);
+ long long points_wanted_in_coverage = (long long)points_wanted * time_coverage / 1000000LL;
- long points_available = (common_last_t - common_first_t) / db_update_every_s;
- long points_delta = (long)(points_available - points_wanted_in_coverage);
- long points_coverage = (points_delta < 0) ? (long)(points_available * time_coverage / points_wanted_in_coverage) : time_coverage;
+ long long points_available = (common_last_t - common_first_t) / db_update_every_s;
+ long long points_delta = (long)(points_available - points_wanted_in_coverage);
+ long long points_coverage = (points_delta < 0) ? (long)(points_available * time_coverage / points_wanted_in_coverage) : time_coverage;
// a way to benefit higher tiers
// points_coverage += (long)tier * 10000;
@@ -742,7 +742,7 @@ static long query_plan_points_coverage_weight(time_t db_first_time_s, time_t db_
if(points_available <= 0)
return -LONG_MAX;
- return points_coverage + (long)(25000 * tier); // 2.5% benefit for each higher tier
+ return (long)(points_coverage + (25000LL * tier)); // 2.5% benefit for each higher tier
}
static size_t query_metric_best_tier_for_timeframe(QUERY_METRIC *qm, time_t after_wanted, time_t before_wanted, size_t points_wanted) {