Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

feat(split): add split reject counters #891

Merged
merged 1 commit into from
Aug 30, 2021
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
8 changes: 8 additions & 0 deletions src/replica/replica.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ replica::replica(
_counter_dup_disabled_non_idempotent_write_count.init_app_counter(
"eon.replica", counter_str.c_str(), COUNTER_TYPE_VOLATILE_NUMBER, counter_str.c_str());

counter_str = fmt::format("recent.read.splitting.reject.count@{}", gpid);
_counter_recent_read_splitting_reject_count.init_app_counter(
"eon.replica", counter_str.c_str(), COUNTER_TYPE_VOLATILE_NUMBER, counter_str.c_str());

counter_str = fmt::format("recent.write.splitting.reject.count@{}", gpid);
_counter_recent_write_splitting_reject_count.init_app_counter(
"eon.replica", counter_str.c_str(), COUNTER_TYPE_VOLATILE_NUMBER, counter_str.c_str());

// init table level latency perf counters
init_table_level_latency_counters();

Expand Down
3 changes: 3 additions & 0 deletions src/replica/replica.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const char *manual_compaction_status_to_string(manual_compaction_status status);
if (_validate_partition_hash) { \
if (_split_mgr->should_reject_request()) { \
response_client_##op_type(request, ERR_SPLITTING); \
_counter_recent_##op_type##_splitting_reject_count->increment(); \
return; \
} \
if (!_split_mgr->check_partition_hash( \
Expand Down Expand Up @@ -567,6 +568,8 @@ class replica : public serverlet<replica>, public ref_counter, public replica_ba
perf_counter_wrapper _counter_recent_read_throttling_reject_count;
perf_counter_wrapper _counter_recent_backup_request_throttling_delay_count;
perf_counter_wrapper _counter_recent_backup_request_throttling_reject_count;
perf_counter_wrapper _counter_recent_write_splitting_reject_count;
perf_counter_wrapper _counter_recent_read_splitting_reject_count;
std::vector<perf_counter *> _counters_table_level_latency;
perf_counter_wrapper _counter_dup_disabled_non_idempotent_write_count;
perf_counter_wrapper _counter_backup_request_qps;
Expand Down