From dc64f46b1c56c6d7d511aa1b161c378feb566199 Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Fri, 9 Dec 2016 16:36:43 -0800 Subject: [PATCH] Add db_bench option for stderr logging Summary: The info log file ("LOG") is stored in the db directory by default. When the db is on a distributed env, this is unnecessarily slow. So, I added an option to db_bench to just print the info log messages to stderr. Closes https://github.com/facebook/rocksdb/pull/1641 Differential Revision: D4309348 Pulled By: ajkr fbshipit-source-id: 1e6f851 --- tools/db_bench_tool.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 44fdfd53c..cf0678a85 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -60,6 +60,7 @@ #include "util/mutexlock.h" #include "util/random.h" #include "util/statistics.h" +#include "util/stderr_logger.h" #include "util/string_util.h" #include "util/testutil.h" #include "util/transaction_test_util.h" @@ -592,6 +593,9 @@ DEFINE_string( DEFINE_bool(report_bg_io_stats, false, "Measure times spents on I/Os while in compactions. "); +DEFINE_bool(use_stderr_info_logger, false, + "Write info logs to stderr instead of to LOG file. "); + DEFINE_bool(use_blob_db, false, "Whether to use BlobDB. "); enum rocksdb::CompressionType StringToCompressionType(const char* ctype) { @@ -2745,6 +2749,9 @@ class Benchmark { exit(1); } } + if (FLAGS_use_stderr_info_logger) { + options.info_log.reset(new StderrLogger()); + } options.memtable_huge_page_size = FLAGS_memtable_use_huge_page ? 2048 : 0; options.memtable_prefix_bloom_size_ratio = FLAGS_memtable_bloom_size_ratio; if (FLAGS_memtable_insert_with_hint_prefix_size > 0) {