From ca92068b12c7d2c4ba9cfc6022dc7dfaf6ba0708 Mon Sep 17 00:00:00 2001 From: Mark Callaghan Date: Wed, 18 Dec 2013 16:50:48 -0800 Subject: [PATCH] Add 'readtocache' test Summary: For some tests I want to cache the database prior to running other tests on the same invocation of db_bench. The readtocache test ignores --threads and --reads so those can be used by other tests and it will still do a full read of --num rows with one thread. It might be invoked like: db_bench --benchmarks=readtocache,readrandom --reads 100 --num 10000 --threads 8 Task ID: # Blame Rev: Test Plan: run db_bench Revert Plan: Database Impact: Memcache Impact: Other Notes: EImportant: - begin *PUBLIC* platform impact section - Bugzilla: # - end platform impact - Reviewers: dhruba CC: leveldb Differential Revision: https://reviews.facebook.net/D14739 --- db/db_bench.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/db_bench.cc b/db/db_bench.cc index 158a5faa2d8..eb5d7cb4217 100644 --- a/db/db_bench.cc +++ b/db/db_bench.cc @@ -48,6 +48,7 @@ DEFINE_string(benchmarks, "compact," "readrandom," "readseq," + "readtocache," "readreverse," "readwhilewriting," "readrandomwriterandom," @@ -75,6 +76,7 @@ DEFINE_string(benchmarks, "\tdeleteseq -- delete N keys in sequential order\n" "\tdeleterandom -- delete N keys in random order\n" "\treadseq -- read N times sequentially\n" + "\treadtocache -- 1 thread reading database sequentially\n" "\treadreverse -- read N times in reverse order\n" "\treadrandom -- read N times in random order\n" "\treadmissing -- read N missing keys in random order\n" @@ -1057,6 +1059,10 @@ class Benchmark { method = &Benchmark::WriteRandom; } else if (name == Slice("readseq")) { method = &Benchmark::ReadSequential; + } else if (name == Slice("readtocache")) { + method = &Benchmark::ReadSequential; + num_threads = 1; + reads_ = num_; } else if (name == Slice("readreverse")) { method = &Benchmark::ReadReverse; } else if (name == Slice("readrandom")) {