ssb: Notifying apps of every single message added isn't practical for big replications. Only notify on the completion of each chunk. Update the tests. The apps need some treatment, but refreshing works around any issues for now.
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled
This commit is contained in:
@ -720,24 +720,21 @@ void tf_ssb_test_bench(const tf_test_options_t* options)
|
||||
tf_ssb_server_open(ssb0, 12347);
|
||||
tf_ssb_connect(ssb1, "127.0.0.1", 12347, id0bin, 0, NULL, NULL);
|
||||
|
||||
tf_printf("Waiting for messages.\n");
|
||||
clock_gettime(CLOCK_REALTIME, &start_time);
|
||||
int count = 0;
|
||||
tf_ssb_add_message_added_callback(ssb1, _message_added, NULL, &count);
|
||||
while (count < k_messages)
|
||||
{
|
||||
uv_run(&loop, UV_RUN_ONCE);
|
||||
}
|
||||
tf_ssb_remove_message_added_callback(ssb1, _message_added, &count);
|
||||
clock_gettime(CLOCK_REALTIME, &end_time);
|
||||
|
||||
tf_ssb_set_main_thread(ssb0, false);
|
||||
tf_ssb_set_main_thread(ssb1, false);
|
||||
count = _ssb_test_count_messages(ssb1);
|
||||
if (count < k_messages)
|
||||
|
||||
tf_printf("Waiting for messages.\n");
|
||||
clock_gettime(CLOCK_REALTIME, &start_time);
|
||||
while (_ssb_test_count_messages(ssb1) < k_messages)
|
||||
{
|
||||
abort();
|
||||
tf_ssb_set_main_thread(ssb0, true);
|
||||
tf_ssb_set_main_thread(ssb1, true);
|
||||
uv_run(&loop, UV_RUN_ONCE);
|
||||
tf_ssb_set_main_thread(ssb0, false);
|
||||
tf_ssb_set_main_thread(ssb1, false);
|
||||
}
|
||||
clock_gettime(CLOCK_REALTIME, &end_time);
|
||||
|
||||
tf_printf("Done.\n");
|
||||
tf_printf("replicate = %f seconds\n", (end_time.tv_sec - start_time.tv_sec) + (end_time.tv_nsec - start_time.tv_nsec) / 1e9);
|
||||
|
||||
|
Reference in New Issue
Block a user