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

Commit

Permalink
feat(split): add split reject counters (#891)
Browse files Browse the repository at this point in the history
  • Loading branch information
hycdong authored Aug 30, 2021
1 parent 021d9f4 commit 6135e45
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
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

0 comments on commit 6135e45

Please sign in to comment.