Search in sources :

Example 1 with LogAppenderMetrics

use of org.apache.ratis.server.metrics.LogAppenderMetrics in project incubator-ratis by apache.

the class TestLogAppenderMetrics method setup.

@Before
public void setup() {
    RaftGroupId raftGroupId = RaftGroupId.randomId();
    raftPeerId = RaftPeerId.valueOf("TestId");
    RaftGroupMemberId raftGroupMemberId = RaftGroupMemberId.valueOf(raftPeerId, raftGroupId);
    followerInfo = new MyFollowerInfo(100L);
    LogAppenderMetrics logAppenderMetrics = new LogAppenderMetrics(raftGroupMemberId);
    ratisMetricRegistry = logAppenderMetrics.getRegistry();
    logAppenderMetrics.addFollowerGauges(raftPeerId, followerInfo::getNextIndex, followerInfo::getMatchIndex, followerInfo::getLastRpcTime);
}
Also used : LogAppenderMetrics(org.apache.ratis.server.metrics.LogAppenderMetrics) RaftGroupId(org.apache.ratis.protocol.RaftGroupId) RaftGroupMemberId(org.apache.ratis.protocol.RaftGroupMemberId) Before(org.junit.Before)

Aggregations

RaftGroupId (org.apache.ratis.protocol.RaftGroupId)1 RaftGroupMemberId (org.apache.ratis.protocol.RaftGroupMemberId)1 LogAppenderMetrics (org.apache.ratis.server.metrics.LogAppenderMetrics)1 Before (org.junit.Before)1