persistent_cache: fix two timer

Summary:
In persistent_cache/block_cache_tier.cc, timers are never restarted, so the latency measured is not correct.
Closes https://github.com/facebook/rocksdb/pull/1707

Differential Revision: D4355828

Pulled By: siying

fbshipit-source-id: cd5f9e1
This commit is contained in:
Siying Dong 2016-12-21 13:29:26 -08:00 committed by Facebook Github Bot
parent 046099c9b5
commit 3d692822f8

View File

@ -220,7 +220,7 @@ Status BlockCacheTier::InsertImpl(const Slice& key, const Slice& data) {
assert(data.size());
assert(cache_file_);
StopWatchNano timer(opt_.env);
StopWatchNano timer(opt_.env, /*auto_start=*/ true);
WriteLock _(&lock_);
@ -263,7 +263,7 @@ Status BlockCacheTier::InsertImpl(const Slice& key, const Slice& data) {
Status BlockCacheTier::Lookup(const Slice& key, unique_ptr<char[]>* val,
size_t* size) {
StopWatchNano timer(opt_.env);
StopWatchNano timer(opt_.env, /*auto_start=*/ true);
LBA lba;
bool status;