RpcClientMetricsCollector { public void rpcCompleted(String destination, Object reply) { Meter specificMeter = metrics.getMeter( identifierPrefix, "completed", destination); mark(specificMeter, totalNumberOfCompletedRequests); } RpcClientMetricsCollector(String identifier, Metrics metrics); void rpcCompleted(String destination, Object reply); void rpcTimedOut(String destination);  }
@Test void rpcCompleted() { sut.rpcCompleted("req1", "reply1"); assertThat(metrics.getMeter("rpcClient","completed","total").getCount(), is(1L)); assertThat(metrics.getMeter("rpcClient","completed","req1").getCount(), is(1L)); assertThat(metrics.getMeter("rpcClient","timeout","total").getCount(), is(0L)); assertThat(metrics.getMeter("rpcClient","timeout","req1").getCount(), is(0L)); }
@Test void rpcCompletedWithNullRequestAndReplyPossible() { sut.rpcCompleted("dest", null); assertThat(metrics.getMeter("rpcClient","completed","total").getCount(), is(1L)); assertThat(metrics.getMeter("rpcClient","completed","dest").getCount(), is(1L)); assertThat(metrics.getMeter("rpcClient","timeout","total").getCount(), is(0L)); assertThat(metrics.getMeter("rpcClient","timeout","dest").getCount(), is(0L)); }