diff options
Diffstat (limited to 'daemon/unit_test.c')
-rw-r--r-- | daemon/unit_test.c | 8 |
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]); |