Created
November 7, 2017 09:01
Star
You must be signed in to star a gist
example showing how to instrument ok http client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MetricRegistry metricRegistry = new MetricRegistry(); | |
final ConsoleReporter reporter = ConsoleReporter.forRegistry(metricRegistry).convertRatesTo(TimeUnit.SECONDS) | |
.convertDurationsTo(TimeUnit.MILLISECONDS).build(); | |
GitHub github = Feign.builder().invocationHandlerFactory( | |
// instrumenting feign | |
new FeignOutboundMetricsDecorator(new InvocationHandlerFactory.Default(), metricRegistry)) | |
// instrumenting ok http | |
.client(new OkHttpClient(InstrumentedOkHttpClients.create(metricRegistry))) | |
.decoder(new GsonDecoder()).target(GitHub.class, "https://api.github.com"); | |
execute... | |
reporter.report(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment