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
main
Siying Dong 8 years ago committed by Facebook Github Bot
parent 046099c9b5
commit 3d692822f8
  1. 4
      utilities/persistent_cache/block_cache_tier.cc

@ -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;

Loading…
Cancel
Save