#include "utilities/persistent_cache/block_cache_tier.h"
-#include <regex>
#include <utility>
#include <vector>
return Status::OK();
}
-template<class T>
+template <class T>
void Add(std::map<std::string, double>* stats, const std::string& key,
const T& t) {
stats->insert({key, static_cast<double>(t)});
stats_.bytes_read_.Average());
Add(&stats, "persistentcache.blockcachetier.insert_dropped",
stats_.insert_dropped_);
- Add(&stats, "persistentcache.blockcachetier.cache_hits",
- stats_.cache_hits_);
+ Add(&stats, "persistentcache.blockcachetier.cache_hits", stats_.cache_hits_);
Add(&stats, "persistentcache.blockcachetier.cache_misses",
stats_.cache_misses_);
Add(&stats, "persistentcache.blockcachetier.cache_errors",
assert(data.size());
assert(cache_file_);
- StopWatchNano timer(opt_.env, /*auto_start=*/ true);
+ StopWatchNano timer(opt_.clock, /*auto_start=*/true);
WriteLock _(&lock_);
Status BlockCacheTier::Lookup(const Slice& key, std::unique_ptr<char[]>* val,
size_t* size) {
- StopWatchNano timer(opt_.env, /*auto_start=*/ true);
+ StopWatchNano timer(opt_.clock, /*auto_start=*/true);
LBA lba;
bool status;
TEST_SYNC_POINT_CALLBACK("BlockCacheTier::NewCacheFile:DeleteDir",
(void*)(GetCachePath().c_str()));
- std::unique_ptr<WriteableCacheFile> f(
- new WriteableCacheFile(opt_.env, &buffer_allocator_, &writer_,
- GetCachePath(), writer_cache_id_,
- opt_.cache_file_size, opt_.log));
+ std::unique_ptr<WriteableCacheFile> f(new WriteableCacheFile(
+ opt_.env, &buffer_allocator_, &writer_, GetCachePath(), writer_cache_id_,
+ opt_.cache_file_size, opt_.log));
bool status = f->Create(opt_.enable_direct_writes, opt_.enable_direct_reads);
if (!status) {