You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by "acelyc111 (via GitHub)" <gi...@apache.org> on 2023/04/19 07:58:09 UTC
[GitHub] [incubator-pegasus] acelyc111 commented on a diff in pull request #1455: feat(new_metrics): migrate server-level metrics for replica_stub (part 1)
acelyc111 commented on code in PR #1455:
URL: https://github.com/apache/incubator-pegasus/pull/1455#discussion_r1170957831
##########
src/replica/replica.h:
##########
@@ -284,7 +284,7 @@ class replica : public serverlet<replica>, public ref_counter, public replica_ba
//
// Statistics
//
- void update_commit_qps(int count);
+ METRIC_DECLARE_INCREMENT_BY(committed_requests, );
Review Comment:
It's strange too to pass such style of parameters.
##########
src/replica/replica.cpp:
##########
@@ -229,11 +228,7 @@ void replica::update_last_checkpoint_generate_time()
// //
// Statistics //
// //
-
-void replica::update_commit_qps(int count)
-{
- _stub->_counter_replicas_commit_qps->add((uint64_t)count);
-}
+METRIC_IMPL_INCREMENT_BY(*_stub, committed_requests, replica::)
Review Comment:
It‘s a bit of strange to pass a namesapce as a "parameter", would it better to define functions manually?
##########
src/replica/replica_stub.cpp:
##########
@@ -2032,10 +2042,10 @@ task_ptr replica_stub::begin_open_replica(
if (rep->status() == partition_status::PS_INACTIVE && tsk->cancel(false)) {
// reopen it
_closing_replicas.erase(it);
- _counter_replicas_closing_count->decrement();
+ METRIC_VAR_DECREMENT(closing_replicas);
Review Comment:
If needed, it's better to consider define a new metric type `FunctionGauge`, ref https://github.com/apache/kudu/blob/master/src/kudu/util/metrics.h#L1223
We can improve it in future refactoring.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org