@Test public void testOnLeaderElectionCompletion() throws Exception { leaderElectionMetrics.onLeaderElectionCompletion(500L); Long leaderElectionLatency = (Long) ratisMetricRegistry.getGauges((s, metric) -> s.contains(LEADER_ELECTION_LATENCY)).values().iterator().next().getValue(); assertEquals(500L, leaderElectionLatency.longValue()); }
public void onLeaderElectionCompletion(long elapsedTime) { this.leaderElectionCompletionLatency = elapsedTime; }
LeaderElectionMetrics extends RatisMetrics { public void onLeaderElectionCompletion(long elapsedTime) { this.leaderElectionCompletionLatency = elapsedTime; } }
LeaderElectionMetrics extends RatisMetrics { public void onLeaderElectionCompletion(long elapsedTime) { this.leaderElectionCompletionLatency = elapsedTime; } private  LeaderElectionMetrics(RaftServerImpl raftServer); }
LeaderElectionMetrics extends RatisMetrics { public void onLeaderElectionCompletion(long elapsedTime) { this.leaderElectionCompletionLatency = elapsedTime; } private  LeaderElectionMetrics(RaftServerImpl raftServer); static LeaderElectionMetrics getLeaderElectionMetrics(RaftServerImpl raftServer); void onNewLeaderElection(); void onLeaderElectionCompletion(long elapsedTime); void onLeaderElectionTimeout(); }
LeaderElectionMetrics extends RatisMetrics { public void onLeaderElectionCompletion(long elapsedTime) { this.leaderElectionCompletionLatency = elapsedTime; } private  LeaderElectionMetrics(RaftServerImpl raftServer); static LeaderElectionMetrics getLeaderElectionMetrics(RaftServerImpl raftServer); void onNewLeaderElection(); void onLeaderElectionCompletion(long elapsedTime); void onLeaderElectionTimeout(); static final String RATIS_LEADER_ELECTION_METRICS; static final String RATIS_LEADER_ELECTION_METRICS_DESC; static final String LEADER_ELECTION_COUNT_METRIC; static final String LEADER_ELECTION_TIMEOUT_COUNT_METRIC; static final String LEADER_ELECTION_LATENCY; static final String LAST_LEADER_ELAPSED_TIME; }