Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cloud/src/common/bvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ bvar::LatencyRecorder g_bvar_txn_kv_get_read_version("txn_kv", "get_read_version
bvar::LatencyRecorder g_bvar_txn_kv_get_committed_version("txn_kv", "get_committed_version");
bvar::LatencyRecorder g_bvar_txn_kv_batch_get("txn_kv", "batch_get");

bvar::Adder<int64_t> g_bvar_txn_kv_get_count_normalized("txn_kv", "get_count_normalized");

bvar::Adder<int64_t> g_bvar_txn_kv_commit_error_counter;
bvar::Window<bvar::Adder<int64_t> > g_bvar_txn_kv_commit_error_counter_minute(
"txn_kv", "commit_error", &g_bvar_txn_kv_commit_error_counter, 60);
Expand Down
1 change: 1 addition & 0 deletions cloud/src/common/bvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ extern bvar::LatencyRecorder g_bvar_txn_kv_batch_get;

extern bvar::Adder<int64_t> g_bvar_txn_kv_commit_error_counter;
extern bvar::Adder<int64_t> g_bvar_txn_kv_commit_conflict_counter;
extern bvar::Adder<int64_t> g_bvar_txn_kv_get_count_normalized;

extern const int64_t BVAR_FDB_INVALID_VALUE;
extern bvar::Status<int64_t> g_bvar_fdb_client_count;
Expand Down
3 changes: 3 additions & 0 deletions cloud/src/meta-service/txn_kv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ TxnErrorCode Transaction::get(std::string_view key, std::string* val, bool snaps
approximate_bytes_ += key.size() * 2; // See fdbclient/ReadYourWrites.actor.cpp for details
auto* fut = fdb_transaction_get(txn_, (uint8_t*)key.data(), key.size(), snapshot);

g_bvar_txn_kv_get_count_normalized << 1;
auto release_fut = [fut, &sw](int*) {
fdb_future_destroy(fut);
g_bvar_txn_kv_get << sw.elapsed_us();
Expand Down Expand Up @@ -434,6 +435,7 @@ TxnErrorCode Transaction::get(std::string_view begin, std::string_view end,

std::unique_ptr<RangeGetIterator> ret(new RangeGetIterator(fut));
RETURN_IF_ERROR(ret->init());
g_bvar_txn_kv_get_count_normalized << ret->size();

*(iter) = std::move(ret);

Expand Down Expand Up @@ -619,6 +621,7 @@ TxnErrorCode Transaction::batch_get(std::vector<std::optional<std::string>>* res

size_t num_keys = keys.size();
res->reserve(keys.size());
g_bvar_txn_kv_get_count_normalized << keys.size();
std::vector<std::unique_ptr<FDBFuture, FDBFutureDelete>> futures;
futures.reserve(opts.concurrency);
for (size_t i = 0; i < num_keys; i += opts.concurrency) {
Expand Down