#include <sstream>
#include <unordered_map>
-#include "rocksdb/env.h"
-
-#include "utilities/persistent_cache/block_cache_tier.h"
-#include "utilities/persistent_cache/persistent_cache_tier.h"
-#include "utilities/persistent_cache/volatile_tier_impl.h"
-
#include "monitoring/histogram.h"
#include "port/port.h"
+#include "rocksdb/env.h"
+#include "rocksdb/system_clock.h"
#include "table/block_based/block_builder.h"
#include "util/gflags_compat.h"
#include "util/mutexlock.h"
#include "util/stop_watch.h"
+#include "utilities/persistent_cache/block_cache_tier.h"
+#include "utilities/persistent_cache/persistent_cache_tier.h"
+#include "utilities/persistent_cache/volatile_tier_impl.h"
DEFINE_int32(nsec, 10, "nsec");
DEFINE_int32(nthread_write, 1, "Insert threads");
std::bind(&CacheTierBenchmark::Read, this));
// Wait till FLAGS_nsec and then signal to quit
- StopWatchNano t(Env::Default(), /*auto_start=*/true);
+ StopWatchNano t(SystemClock::Default().get(), /*auto_start=*/true);
size_t sec = t.ElapsedNanos() / 1000000000ULL;
while (!quit_) {
sec = t.ElapsedNanos() / 1000000000ULL;
auto block = NewBlock(key);
// insert
- StopWatchNano timer(Env::Default(), /*auto_start=*/true);
+ StopWatchNano timer(SystemClock::Default().get(), /*auto_start=*/true);
while (true) {
Status status = cache_->Insert(block_key, block.get(), FLAGS_iosize);
if (status.ok()) {
Slice key = FillKey(k, val);
// Lookup in cache
- StopWatchNano timer(Env::Default(), /*auto_start=*/true);
+ StopWatchNano timer(SystemClock::Default().get(), /*auto_start=*/true);
std::unique_ptr<char[]> block;
size_t size;
Status status = cache_->Lookup(key, &block, &size);
fprintf(stderr, "%s\n", status.ToString().c_str());
}
assert(status.ok());
- assert(size == (size_t) FLAGS_iosize);
+ assert(size == (size_t)FLAGS_iosize);
// adjust stats
const size_t elapsed_micro = timer.ElapsedNanos() / 1000;