0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-28 14:42:31 +00:00

Fix broken dbengine stress tests. ()

This commit is contained in:
Markos Fountoulakis 2021-01-15 12:41:24 +02:00 committed by GitHub
parent 6dade0cd03
commit a21119469b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions
daemon
database/engine

View file

@ -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]);

View file

@ -214,6 +214,10 @@ int is_legacy_child(const char *machine_guid)
uuid_t uuid;
char dbengine_file[FILENAME_MAX+1];
if (unlikely(!strcmp(machine_guid, "unittest-dbengine") || !strcmp(machine_guid, "dbengine-dataset") ||
!strcmp(machine_guid, "dbengine-stress-test"))) {
return 1;
}
if (!uuid_parse(machine_guid, uuid)) {
uv_fs_t stat_req;
snprintfz(dbengine_file, FILENAME_MAX, "%s/%s/dbengine", netdata_configured_cache_dir, machine_guid);