Created
May 24, 2018 13:42
-
-
Save mykidong/1f64fc58f0891f0e74a14155d0673289 to your computer and use it in GitHub Desktop.
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
public class SomeServiceHandler extends SomeServiceGrpc.SomeServiceImplBase { | |
private static final String METRICS_PREFIX = "meter-api." + SomeServiceHandler.class.getSimpleName(); | |
/** | |
* metric registry. | |
*/ | |
private MetricRegistry metricRegistry; | |
// metricRegistry injected. | |
public void setMetricRegistry(MetricRegistry metricRegistry) { | |
this.metricRegistry = metricRegistry; | |
} | |
@Override | |
public void doSearch(...) { | |
this.metricRegistry.meter(METRICS_PREFIX + ".doSearch").mark(); | |
... | |
} | |
@Override | |
public void getSomeStatus(...) { | |
this.metricRegistry.meter(METRICS_PREFIX + ".getSomeStatus").mark(); | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
some service handler.