From 63904434eb87183ea353914b07cd8dc53f40ddac Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Thu, 12 Jul 2018 15:55:07 -0700 Subject: [PATCH] db_bench periodically dump stats to info log (#4109) Summary: give control of how often stats are printed, including jemalloc stats if enabled. Previously the default was 10 minutes so we'd only see updated stats for very long benchmark runs. Pull Request resolved: https://github.com/facebook/rocksdb/pull/4109 Differential Revision: D8796444 Pulled By: ajkr fbshipit-source-id: fd7902fe3f105fae89322c4ab63316bba4a2b15e --- tools/db_bench_tool.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index d12104e86..5915692f8 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -1028,6 +1028,8 @@ DEFINE_bool(identity_as_first_hash, false, "the first hash function of cuckoo " "table becomes an identity function. This is only valid when key " "is 8 bytes"); DEFINE_bool(dump_malloc_stats, true, "Dump malloc stats in LOG "); +DEFINE_uint32(stats_dump_period_sec, rocksdb::Options().stats_dump_period_sec, + "Gap between printing stats to log in seconds"); enum RepFactory { kSkipList, @@ -3367,6 +3369,7 @@ void VerifyDBFromDB(std::string& truth_db_name) { options.wal_dir = FLAGS_wal_dir; options.create_if_missing = !FLAGS_use_existing_db; options.dump_malloc_stats = FLAGS_dump_malloc_stats; + options.stats_dump_period_sec = FLAGS_stats_dump_period_sec; options.compression_opts.level = FLAGS_compression_level; options.compression_opts.max_dict_bytes = FLAGS_compression_max_dict_bytes;