From 898e803fc5cb198d048b7be97f4fbdac04720abb Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Tue, 2 Jun 2015 12:35:12 -0700 Subject: [PATCH] Add a stats counter for DB_WRITE back which was mistakenly removed. Summary: Add a stats counter for DB_WRITE back which was mistakenly removed. Test Plan: augment GroupCommitTest Reviewers: sdong Reviewed By: sdong Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D39399 --- db/db_impl.cc | 2 ++ db/db_test.cc | 3 +++ 2 files changed, 5 insertions(+) diff --git a/db/db_impl.cc b/db/db_impl.cc index 411736cb1..297202400 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -3223,6 +3223,8 @@ Status DBImpl::WriteImpl(const WriteOptions& write_options, RecordTick(stats_, WRITE_WITH_WAL); } + StopWatch write_sw(env_, db_options_.statistics.get(), DB_WRITE); + WriteContext context; mutex_.Lock(); diff --git a/db/db_test.cc b/db/db_test.cc index 90232667e..59ddb8d22 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -8591,6 +8591,9 @@ TEST_F(DBTest, GroupCommitTest) { ASSERT_TRUE(!itr->Valid()); delete itr; + HistogramData hist_data = {0}; + options.statistics->histogramData(DB_WRITE, &hist_data); + ASSERT_GT(hist_data.average, 0.0); } while (ChangeOptions(kSkipNoSeekToLast)); }