diff --git a/include/dsn/dist/replication/replication_app_base.h b/include/dsn/dist/replication/replication_app_base.h index 8a4846fd1a..572029301e 100644 --- a/include/dsn/dist/replication/replication_app_base.h +++ b/include/dsn/dist/replication/replication_app_base.h @@ -294,6 +294,8 @@ class replication_app_base : public replica_base replica_init_info _info; explicit replication_app_base(::dsn::replication::replica *replica); + + dsn::perf_counter *get_counter_recent_read_throttling_reject_count(); }; } // namespace replication diff --git a/src/replica/replica.h b/src/replica/replica.h index 4589623cdc..a555167da5 100644 --- a/src/replica/replica.h +++ b/src/replica/replica.h @@ -48,6 +48,7 @@ #include #include +#include #include "common/replication_common.h" #include "mutation.h" @@ -62,7 +63,6 @@ class access_controller; } // namespace security namespace replication { -class replication_app_base; class replica_stub; class replica_duplicator_manager; class replica_backup_manager; @@ -467,6 +467,8 @@ class replica : public serverlet, public ref_counter, public replica_ba friend class replica_disk_migrator; friend class replica_disk_test; friend class replica_disk_migrate_test; + friend dsn::perf_counter * + replication_app_base::get_counter_recent_read_throttling_reject_count(); // replica configuration, updated by update_local_configuration ONLY replica_configuration _config; diff --git a/src/replica/replication_app_base.cpp b/src/replica/replication_app_base.cpp index 98c4e3d6d2..4b0da8b225 100644 --- a/src/replica/replication_app_base.cpp +++ b/src/replica/replication_app_base.cpp @@ -603,5 +603,13 @@ ::dsn::error_code replication_app_base::update_init_info_ballot_and_decree(repli _info.init_offset_in_private_log, r->last_durable_decree()); } + +dsn::perf_counter *replication_app_base::get_counter_recent_read_throttling_reject_count() +{ + dassert(_replica->_counter_recent_read_throttling_reject_count.get(), + "_counter_recent_read_throttling_reject_count is null"); + + return _replica->_counter_recent_read_throttling_reject_count.get(); +} } // namespace replication } // namespace dsn