Skip to content

Commit 80bd3c0

Browse files
Lizhe Jimeta-codesync[bot]
authored andcommitted
Add RocksDB key-count and rows-written stats
Summary: X-link: https://github.com/facebookresearch/FBGEMM/pull/2833 New methods get_estimated_num_keys and get_total_rows_written. Reviewed By: EddyLXJ Differential Revision: D108357970 fbshipit-source-id: 5e19b106f9c6fedbd9008eba6223790de0e4fd3b
1 parent 0e939d3 commit 80bd3c0

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

fbgemm_gpu/src/ssd_split_embeddings_cache/ssd_table_batched_embeddings.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,22 @@ class EmbeddingRocksDB : public kv_db::EmbeddingKVDB {
10371037
return mem_usages;
10381038
}
10391039

1040+
int64_t get_estimated_num_keys() override {
1041+
int64_t total = 0;
1042+
for (auto& db : dbs_) {
1043+
std::string val;
1044+
db->GetProperty("rocksdb.estimate-num-keys", &val);
1045+
if (!val.empty()) {
1046+
total += folly::to<int64_t>(val);
1047+
}
1048+
}
1049+
return total;
1050+
}
1051+
1052+
int64_t get_total_rows_written() const override {
1053+
return total_rows_written_.load(std::memory_order_relaxed);
1054+
}
1055+
10401056
std::vector<double> get_rocksdb_io_duration(
10411057
const int64_t step,
10421058
const int64_t interval) {

0 commit comments

Comments
 (0)