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

feat(dup): add metrics for duplication #393

Merged
merged 14 commits into from
Feb 19, 2020
Prev Previous commit
Next Next commit
fix name
neverchanje committed Feb 13, 2020
commit c819cfdfe4650b955eec1b89bcf387402063fe3b
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@ void load_from_private_log::replay_log_block()
[this](int log_bytes_length, mutation_ptr &mu) -> bool {
auto es = _mutation_batch.add(std::move(mu));
dassert_replica(es.is_ok(), es.description());
_stub->_counter_dup_log_read_in_bytes_rate->add(log_bytes_length);
_stub->_counter_dup_log_read_bytes_rate->add(log_bytes_length);
_stub->_counter_dup_log_mutations_read_rate->increment();
return true;
},
4 changes: 2 additions & 2 deletions src/dist/replication/lib/replica_stub.cpp
Original file line number Diff line number Diff line change
@@ -221,8 +221,8 @@ void replica_stub::install_perf_counters()

// <- Duplication Metrics ->

_counter_dup_log_read_in_bytes_rate.init_app_counter("eon.replica_stub",
"dup.log_read_in_bytes_rate",
_counter_dup_log_read_bytes_rate.init_app_counter("eon.replica_stub",
"dup.log_read_bytes_rate",
COUNTER_TYPE_RATE,
"reading rate of private log in bytes");
_counter_dup_log_mutations_read_rate.init_app_counter(
2 changes: 1 addition & 1 deletion src/dist/replication/lib/replica_stub.h
Original file line number Diff line number Diff line change
@@ -371,7 +371,7 @@ class replica_stub : public serverlet<replica_stub>, public ref_counter
// <- Duplication Metrics ->
// TODO(wutao1): calculate the counters independently for each remote cluster
// if we need to duplicate to multiple clusters someday.
perf_counter_wrapper _counter_dup_log_read_in_bytes_rate;
perf_counter_wrapper _counter_dup_log_read_bytes_rate;
perf_counter_wrapper _counter_dup_log_mutations_read_rate;
perf_counter_wrapper _counter_dup_shipped_bytes_rate;
perf_counter_wrapper _counter_dup_confirmed_rate;