You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by la...@apache.org on 2019/12/19 08:47:37 UTC

[kudu] branch fix_some_metrics_type created (now d228425)

This is an automated email from the ASF dual-hosted git repository.

laiyingchun pushed a change to branch fix_some_metrics_type
in repository https://gitbox.apache.org/repos/asf/kudu.git.


      at d228425  [metrics] Modify metrics 'raft_term' and 'time_since_last_leader_heartbeat' to MAX merge type

This branch includes the following new commits:

     new d228425  [metrics] Modify metrics 'raft_term' and 'time_since_last_leader_heartbeat' to MAX merge type

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[kudu] 01/01: [metrics] Modify metrics 'raft_term' and 'time_since_last_leader_heartbeat' to MAX merge type

Posted by la...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

laiyingchun pushed a commit to branch fix_some_metrics_type
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit d228425ccd03a7a7d01082c9531e4a0e9a822a24
Author: Yingchun Lai <40...@qq.com>
AuthorDate: Thu Dec 19 16:46:46 2019 +0800

    [metrics] Modify metrics 'raft_term' and 'time_since_last_leader_heartbeat' to MAX merge type
---
 src/kudu/consensus/raft_consensus.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/kudu/consensus/raft_consensus.cc b/src/kudu/consensus/raft_consensus.cc
index c473d13..0a1942d 100644
--- a/src/kudu/consensus/raft_consensus.cc
+++ b/src/kudu/consensus/raft_consensus.cc
@@ -238,7 +238,9 @@ Status RaftConsensus::Start(const ConsensusBootstrapInfo& info,
   round_handler_ = DCHECK_NOTNULL(round_handler);
   mark_dirty_clbk_ = std::move(mark_dirty_clbk);
 
-  term_metric_ = metric_entity->FindOrCreateGauge(&METRIC_raft_term, CurrentTerm());
+  term_metric_ = metric_entity->FindOrCreateGauge(&METRIC_raft_term,
+                                                  CurrentTerm(),
+                                                  MergeType::kMax);
   follower_memory_pressure_rejections_ =
       metric_entity->FindOrCreateCounter(&METRIC_follower_memory_pressure_rejections);
 
@@ -247,7 +249,9 @@ Status RaftConsensus::Start(const ConsensusBootstrapInfo& info,
                                        failed_elections_since_stable_leader_);
 
   METRIC_time_since_last_leader_heartbeat.InstantiateFunctionGauge(
-    metric_entity, Bind(&RaftConsensus::GetMillisSinceLastLeaderHeartbeat, Unretained(this)))
+      metric_entity,
+      Bind(&RaftConsensus::GetMillisSinceLastLeaderHeartbeat, Unretained(this)),
+      MergeType::kMax)
     ->AutoDetach(&metric_detacher_);
 
   // A single Raft thread pool token is shared between RaftConsensus and