Search in sources :

Example 1 with GrpcService

use of org.apache.ratis.grpc.server.GrpcService in project incubator-ratis by apache.

the class TestGrpcMessageMetrics method assertMessageCount.

static void assertMessageCount(RaftServer.Division server) {
    String serverId = server.getId().toString();
    GrpcService service = (GrpcService) RaftServerTestUtil.getServerRpc(server);
    RatisMetricRegistry registry = service.getServerInterceptor().getMetrics().getRegistry();
    String counter_prefix = serverId + "_" + "ratis.grpc.RaftServerProtocolService";
    Assert.assertTrue(registry.counter(counter_prefix + "_" + "requestVote" + "_OK_completed_total").getCount() > 0);
}
Also used : GrpcService(org.apache.ratis.grpc.server.GrpcService) RatisMetricRegistry(org.apache.ratis.metrics.RatisMetricRegistry)

Aggregations

GrpcService (org.apache.ratis.grpc.server.GrpcService)1 RatisMetricRegistry (org.apache.ratis.metrics.RatisMetricRegistry)1