From 8ae2bf53316f25fa4a6a71088291b1accb54f2b2 Mon Sep 17 00:00:00 2001 From: Zhichao Cao Date: Tue, 14 Aug 2018 18:19:25 -0700 Subject: [PATCH] Fix the build and test bugs in the Trace_analyzer (#4274) Summary: The wrong options are used in the trace_analyzer_test, removed. The potential loses integer precision are fixed. Pass the specified testing case, make asan_check Pull Request resolved: https://github.com/facebook/rocksdb/pull/4274 Reviewed By: yiwu-arbug Differential Revision: D9327811 Pulled By: zhichao-cao fbshipit-source-id: d62cb18d6586503a490cd323bfc1c672b68b346e --- tools/trace_analyzer_test.cc | 2 -- tools/trace_analyzer_tool.cc | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/trace_analyzer_test.cc b/tools/trace_analyzer_test.cc index 924c437ed..49cd31ba3 100644 --- a/tools/trace_analyzer_test.cc +++ b/tools/trace_analyzer_test.cc @@ -55,8 +55,6 @@ class TraceAnalyzerTest : public testing::Test { void GenerateTrace(std::string trace_path) { Options options; options.create_if_missing = true; - options.IncreaseParallelism(); - options.OptimizeLevelStyleCompaction(); options.merge_operator = MergeOperators::CreatePutOperator(); ReadOptions ro; WriteOptions wo; diff --git a/tools/trace_analyzer_tool.cc b/tools/trace_analyzer_tool.cc index fda625e7e..fc95b6a08 100644 --- a/tools/trace_analyzer_tool.cc +++ b/tools/trace_analyzer_tool.cc @@ -740,7 +740,7 @@ Status TraceAnalyzer::MakeStatisticCorrelation(TraceStats& stats, // Process the statistics of QPS Status TraceAnalyzer::MakeStatisticQPS() { - uint32_t duration = (end_time_ - begin_time_) / 1000000; + uint32_t duration = static_cast((end_time_ - begin_time_) / 1000000); int ret; Status s; std::vector> type_qps( @@ -1098,7 +1098,7 @@ Status TraceAnalyzer::KeyStatsInsertion(const uint32_t& type, if (ts < begin_time_) { time_in_sec = 0; } else { - time_in_sec = (ts - begin_time_) / 1000000; + time_in_sec = static_cast((ts - begin_time_) / 1000000); } uint64_t dist_value_size = value_size / FLAGS_value_interval;