RetrofitMeterIdPrefixFunction implements MeterIdPrefixFunction { public static RetrofitMeterIdPrefixFunction of(String name) { return new RetrofitMeterIdPrefixFunction(name); } private  RetrofitMeterIdPrefixFunction(String name); static RetrofitMeterIdPrefixFunction of(String name); @Override MeterIdPrefix activeRequestPrefix(MeterRegistry registry, RequestOnlyLog log); @Override MeterIdPrefix completeRequestPrefix(MeterRegistry registry, RequestLog log);  }
@Test void metrics() { final RetrofitMeterIdPrefixFunction meterIdPrefixFunction = RetrofitMeterIdPrefixFunction.of("foo"); final String serviceTag = "service=" + Example.class.getName(); final Example example = ArmeriaRetrofit .of(WebClient.builder(server.httpUri()) .factory(clientFactory) .decorator(MetricCollectingClient.newDecorator(meterIdPrefixFunction)) .build()) .create(Example.class); example.getFoo().join(); await().untilAsserted(() -> assertThat(MoreMeters.measureAll(meterRegistry)) .containsKeys( "foo.active.requests#value{http.method=GET,method=getFoo,path=/foo," + serviceTag + '}', "foo.request.duration#count{" + "http.method=GET,http.status=200,method=getFoo,path=/foo," + serviceTag + '}')); example.postFoo().join(); await().untilAsserted(() -> assertThat(MoreMeters.measureAll(meterRegistry)) .containsKeys( "foo.active.requests#value{http.method=GET,method=getFoo,path=/foo," + serviceTag + '}', "foo.request.duration#count{" + "http.method=POST,http.status=200,method=postFoo,path=/foo," + serviceTag + '}')); example.traceFoo().join(); await().untilAsserted(() -> assertThat(MoreMeters.measureAll(meterRegistry)) .containsKeys( "foo.active.requests#value{http.method=TRACE,method=traceFoo,path=/foo," + serviceTag + '}', "foo.request.duration#count{" + "http.method=TRACE,http.status=200,method=traceFoo,path=/foo," + serviceTag + '}')); }