Skip to content

Commit

Permalink
Revert "Add counters for SST File reads/blocks in MultiGet." (#309)
Browse files Browse the repository at this point in the history
This reverts commit a635079.
  • Loading branch information
dpetrov4 authored Dec 13, 2023
1 parent 376b44f commit 20cac21
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 46 deletions.
30 changes: 0 additions & 30 deletions db/version_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2521,17 +2521,9 @@ void Version::MultiGet(const ReadOptions& read_options, MultiGetRange* range,
if (fp.GetHitFileLevel() == 0) {
dump_stats_for_l0_file = true;
}
// RocksDB-Cloud contribution begin
RecordTick(db_statistics_, MULTIGET_SST_FILE_READ_COUNT, 1);
// RocksDB-Cloud contribution end
}
if (s.ok()) {
f = fp.GetNextFileInLevel();
// RocksDB-Cloud contribution begin
if (f) {
RecordTick(db_statistics_, MULTIGET_SST_SERIALIZED_FILE_READ_COUNT, 1);
}
// RocksDB-Cloud contribution end
}
#if USE_COROUTINES
} else {
Expand Down Expand Up @@ -2575,9 +2567,6 @@ void Version::MultiGet(const ReadOptions& read_options, MultiGetRange* range,
if (mget_tasks.size() > 0) {
RecordTick(db_statistics_, MULTIGET_COROUTINE_COUNT,
mget_tasks.size());
// RocksDB-Cloud contribution begin
RecordTick(db_statistics_, MULTIGET_SST_FILE_READ_COUNT, mget_tasks.size());
// RocksDB-Cloud contribution end
// Collect all results so far
std::vector<Status> statuses = folly::coro::blockingWait(
folly::coro::collectAllRange(std::move(mget_tasks))
Expand All @@ -2593,12 +2582,6 @@ void Version::MultiGet(const ReadOptions& read_options, MultiGetRange* range,

if (s.ok() && fp.KeyMaySpanNextFile()) {
f = fp.GetNextFileInLevel();
// RocksDB-Cloud contribution begin
if (f) {
RecordTick(db_statistics_,
MULTIGET_SST_SERIALIZED_FILE_READ_COUNT, 1);
}
// RocksDB-Cloud contribution end
}
}
#endif // USE_COROUTINES
Expand Down Expand Up @@ -2780,10 +2763,6 @@ Status Version::ProcessBatch(
table_handle, std::get<0>(stat->second),
std::get<1>(stat->second),
std::get<2>(stat->second));
// RocksDB-Cloud contribution begin
RecordTick(db_statistics_,
MULTIGET_SST_FILE_READ_COUNT, mget_tasks.size());
// RocksDB-Cloud contribution end
} else {
mget_tasks.emplace_back(MultiGetFromSSTCoroutine(
read_options, file_range, fp.GetHitFileLevel(), skip_filters,
Expand Down Expand Up @@ -2874,10 +2853,6 @@ Status Version::MultiGetAsync(
if (mget_tasks.size() > 0) {
assert(waiting.size());
RecordTick(db_statistics_, MULTIGET_COROUTINE_COUNT, mget_tasks.size());
// RocksDB-Cloud contribution begin
RecordTick(db_statistics_,
MULTIGET_SST_FILE_READ_COUNT, mget_tasks.size());
// RocksDB-Cloud contribution end
// Collect all results so far
std::vector<Status> statuses = folly::coro::blockingWait(
folly::coro::collectAllRange(std::move(mget_tasks))
Expand All @@ -2904,11 +2879,6 @@ Status Version::MultiGetAsync(
// and no need to prepare the next level.
if (!fp.GetHitFile() && !fp.GetRange().empty()) {
fp.PrepareNextLevelForSearch();
} else {
// RocksDB-Cloud contribution begin
RecordTick(db_statistics_,
MULTIGET_SST_SERIALIZED_FILE_READ_COUNT, 1);
// RocksDB-Cloud contribution end
}
}
to_process.swap(waiting);
Expand Down
9 changes: 0 additions & 9 deletions include/rocksdb/statistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -452,15 +452,6 @@ enum Tickers : uint32_t {
READ_ASYNC_MICROS,
// Number of errors returned to the async read callback
ASYNC_READ_ERROR_COUNT,

// RocksDB-Cloud contribution begin

// Total number of files read in MultiGet operations
MULTIGET_SST_FILE_READ_COUNT,
// Number of times file reads were serialized behind other reads
MULTIGET_SST_SERIALIZED_FILE_READ_COUNT,

// RocksDB-Cloud contribution end

TICKER_ENUM_MAX
};
Expand Down
8 changes: 1 addition & 7 deletions monitoring/statistics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,7 @@ const std::vector<std::pair<Tickers, std::string>> TickersNameMap = {
{BLOB_DB_CACHE_BYTES_READ, "rocksdb.blobdb.cache.bytes.read"},
{BLOB_DB_CACHE_BYTES_WRITE, "rocksdb.blobdb.cache.bytes.write"},
{READ_ASYNC_MICROS, "rocksdb.read.async.micros"},
{ASYNC_READ_ERROR_COUNT, "rocksdb.async.read.error.count"},
// RocksDB-Cloud contribution begin
{MULTIGET_SST_FILE_READ_COUNT, "rodksdb.number.multiget.sst_file_reads"},
{MULTIGET_SST_SERIALIZED_FILE_READ_COUNT,
"rocksdb.number.multiget.sst_serialized_file_reads"}
// RocksDB-Cloud contribution end
};
{ASYNC_READ_ERROR_COUNT, "rocksdb.async.read.error.count"}};

const std::vector<std::pair<Histograms, std::string>> HistogramsNameMap = {
{DB_GET, "rocksdb.db.get.micros"},
Expand Down

0 comments on commit 20cac21

Please sign in to comment.