Commit 2c45ee3a authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5418 add --verify_period to benchmark-test


git-svn-id: file:///svn/toku/tokudb@49772 c7de825b-a66e-492c-adef-691d508d4ae1
parent df8d7e9f
......@@ -2,7 +2,6 @@ cmake_policy(SET CMP0012 NEW)
## these tests shouldn't run with valgrind
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
ft/benchmark-test_256
ft/bnc-insert-benchmark
ft/brt-serialize-benchmark
ft/ft_loader-test-extractor-1
......@@ -52,11 +51,6 @@ list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
ydb/upgrade-test-4.tdb
)
## this is a smaller benchmark-test_256, just for valgrind, no need to run it without valgrind
list(APPEND CTEST_CUSTOM_TESTS_IGNORE
ft/benchmark-test_256_vg
)
if (NOT @RUN_HELGRIND_TESTS@)
list(APPEND CTEST_CUSTOM_TESTS_IGNORE
util/helgrind_test_circular_buffer
......
......@@ -50,12 +50,10 @@ if(BUILD_TESTING OR BUILD_FT_TESTS)
declare_custom_tests(benchmark-test)
add_test(ft/benchmark-test benchmark-test -q --fname benchmark-test.ft)
add_test(ft/benchmark-test_256 benchmark-test --valsize 256 --verify --fname benchmark-test_256.ft 1)
add_test(ft/benchmark-test_256_vg benchmark-test --valsize 256 --verify --fname benchmark-test_256_vg.ft --periter 131072 1)
add_test(ft/benchmark-test_256 benchmark-test --valsize 256 --verify --verify_period 4096 --fname benchmark-test_256.ft 1)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
benchmark-test.ft
benchmark-test_256.ft
benchmark-test_256_vg.ft
)
declare_custom_tests(ftloader-test-merge-files-dbufio)
......
......@@ -24,6 +24,7 @@ static enum toku_compression_method compression_method = TOKU_DEFAULT_COMPRESSIO
static int keysize = sizeof (long long);
static int valsize = sizeof (long long);
static int do_verify =0; /* Do a slow verify after every insert. */
static int verify_period = 1; /* how many inserts between verifies. */
static int do_serial = 1;
static int do_random = 1;
......@@ -57,7 +58,13 @@ static void insert (long long v) {
memset(vc, 0, sizeof vc);
long_long_to_array(vc, v);
toku_ft_insert(t, toku_fill_dbt(&kt, kc, keysize), toku_fill_dbt(&vt, vc, valsize), 0);
if (do_verify) toku_cachetable_verify(ct);
if (do_verify) {
static int inserts_since_last_verify = 0;
inserts_since_last_verify++;
if (inserts_since_last_verify % verify_period == 0) {
toku_cachetable_verify(ct);
}
}
}
static void serial_insert_from (long long from) {
......@@ -120,6 +127,7 @@ static void usage(void) {
printf("[--noserial]\n");
printf("[--norandom]\n");
printf("[--verify]\n");
printf("[--verify_period PERIOD]\n");
}
int
......@@ -153,6 +161,11 @@ test_main (int argc, const char *argv[]) {
}
} else if (strcmp(arg, "--verify")==0) {
do_verify = 1;
} else if (strcmp(arg, "--verify_period")==0) {
if (i+1 < argc) {
i++;
verify_period = atoi(argv[i]);
}
} else if (strcmp(arg, "--noserial") == 0) {
do_serial = 0;
} else if (strcmp(arg, "--fname") == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment