summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorMarkos Fountoulakis <44345837+mfundul@users.noreply.github.com>2021-01-15 12:41:24 +0200
committerGitHub <noreply@github.com>2021-01-15 12:41:24 +0200
commita21119469b21513a84933780d534b9105d10daff (patch)
tree66ddf3286eff39cccdb62616e797ae421395b347 /daemon
parent6dade0cd03d154623222305a5e883ae5b345017c (diff)
Fix broken dbengine stress tests. (#10502)
Diffstat (limited to 'daemon')
-rw-r--r--daemon/unit_test.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/daemon/unit_test.c b/daemon/unit_test.c
index 10fa8e4ba7..c26d177299 100644
--- a/daemon/unit_test.c
+++ b/daemon/unit_test.c
@@ -2099,7 +2099,7 @@ void dbengine_stress_test(unsigned TEST_DURATION_SEC, unsigned DSET_CHARTS, unsi
struct dbengine_chart_thread **chart_threads;
struct dbengine_query_thread **query_threads;
unsigned i, j;
- time_t time_start, time_end;
+ time_t time_start, test_duration;
error_log_limit_unlimited();
@@ -2195,8 +2195,8 @@ void dbengine_stress_test(unsigned TEST_DURATION_SEC, unsigned DSET_CHARTS, unsi
for (i = 0 ; i < QUERY_THREADS ; ++i) {
assert(0 == uv_thread_join(&query_threads[i]->thread));
}
- time_end = now_realtime_sec();
- fprintf(stderr, "\nDB-engine stress test finished in %ld seconds.\n", time_end - time_start);
+ test_duration = now_realtime_sec() - (time_start - HISTORY_SECONDS);
+ fprintf(stderr, "\nDB-engine stress test finished in %ld seconds.\n", test_duration);
unsigned long stored_metrics_nr = 0;
for (i = 0 ; i < DSET_CHARTS ; ++i) {
stored_metrics_nr += chart_threads[i]->stored_metrics_nr;
@@ -2213,7 +2213,7 @@ void dbengine_stress_test(unsigned TEST_DURATION_SEC, unsigned DSET_CHARTS, unsi
fprintf(stderr, "Query starting time is randomly chosen from the beginning of the time-series up to the time of\n"
"the latest data point, and ending time from 1 second up to 1 hour after the starting time.\n");
fprintf(stderr, "Performance is %lu written data points/sec and %lu read data points/sec.\n",
- stored_metrics_nr / (time_end - time_start), queried_metrics_nr / (time_end - time_start));
+ stored_metrics_nr / test_duration, queried_metrics_nr / test_duration);
for (i = 0 ; i < DSET_CHARTS ; ++i) {
freez(chart_threads[i]);