@Test public void testOnLeaderElectionTimeout() throws Exception { long numLeaderElectionTimeouts = ratisMetricRegistry.counter( LEADER_ELECTION_TIMEOUT_COUNT_METRIC).getCount(); assertTrue(numLeaderElectionTimeouts == 0); leaderElectionMetrics.onLeaderElectionTimeout(); numLeaderElectionTimeouts = ratisMetricRegistry.counter(LEADER_ELECTION_TIMEOUT_COUNT_METRIC).getCount(); assertEquals(1, numLeaderElectionTimeouts); }
public void onLeaderElectionTimeout() { registry.counter(LEADER_ELECTION_TIMEOUT_COUNT_METRIC).inc(); }
LeaderElectionMetrics extends RatisMetrics { public void onLeaderElectionTimeout() { registry.counter(LEADER_ELECTION_TIMEOUT_COUNT_METRIC).inc(); } }
LeaderElectionMetrics extends RatisMetrics { public void onLeaderElectionTimeout() { registry.counter(LEADER_ELECTION_TIMEOUT_COUNT_METRIC).inc(); } private  LeaderElectionMetrics(RaftServerImpl raftServer); }
LeaderElectionMetrics extends RatisMetrics { public void onLeaderElectionTimeout() { registry.counter(LEADER_ELECTION_TIMEOUT_COUNT_METRIC).inc(); } private  LeaderElectionMetrics(RaftServerImpl raftServer); static LeaderElectionMetrics getLeaderElectionMetrics(RaftServerImpl raftServer); void onNewLeaderElection(); void onLeaderElectionCompletion(long elapsedTime); void onLeaderElectionTimeout(); }
LeaderElectionMetrics extends RatisMetrics { public void onLeaderElectionTimeout() { registry.counter(LEADER_ELECTION_TIMEOUT_COUNT_METRIC).inc(); } 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; }