You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2022/12/07 08:22:08 UTC

[GitHub] [ratis] qian0817 opened a new pull request, #796: RATIS-1757: Missing some metrics for listener.

qian0817 opened a new pull request, #796:
URL: https://github.com/apache/ratis/pull/796

   ## What changes were proposed in this pull request?
   
   (Please fill in changes proposed in this fix)
   
   ## What is the link to the Apache JIRA
   
   [RATIS-1757](https://issues.apache.org/jira/browse/RATIS-1757)
   
   ## How was this patch tested?
   
   


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ratis] qian0817 commented on pull request #796: RATIS-1757: Missing some metrics for listener.

Posted by GitBox <gi...@apache.org>.
qian0817 commented on PR #796:
URL: https://github.com/apache/ratis/pull/796#issuecomment-1342532896

   > Thanks a lot for working on this, @qian0817 !
   > 
   > +1 the change looks good.
   > 
   > Just found that `RaftServerMetricsImpl.followerLastHeartbeatElapsedTimeMap` should use a `ConcurrentHashMap`. Could you also change it?
   > 
   > ```java
   > +++ b/ratis-server/src/main/java/org/apache/ratis/server/metrics/RaftServerMetricsImpl.java
   > @@ -20,7 +20,6 @@ package org.apache.ratis.server.metrics;
   >  
   >  import java.util.Optional;
   >  import java.util.concurrent.ConcurrentHashMap;
   > -import java.util.HashMap;
   >  import java.util.Map;
   >  import java.util.function.Function;
   >  import java.util.function.Supplier;
   > @@ -98,7 +97,7 @@ public final class RaftServerMetricsImpl extends RatisMetrics implements RaftSer
   >        = newHeartbeatTimer(FOLLOWER_APPEND_ENTRIES_LATENCY);
   >  
   >    /** Follower Id -> heartbeat elapsed */
   > -  private final Map<RaftPeerId, Long> followerLastHeartbeatElapsedTimeMap = new HashMap<>();
   > +  private final Map<RaftPeerId, Long> followerLastHeartbeatElapsedTimeMap = new ConcurrentHashMap<>();
   >    private final Supplier<Function<RaftPeerId, CommitInfoProto>> commitInfoCache;
   >  
   >    /** id -> metric */
   > ```
   
   fix.


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ratis] szetszwo merged pull request #796: RATIS-1757: Missing some metrics for listener.

Posted by GitBox <gi...@apache.org>.
szetszwo merged PR #796:
URL: https://github.com/apache/ratis/pull/796


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org