Last active
January 16, 2017 11:05
-
-
Save autoletics/1fa628c48153bd5a604f77928bc36822 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
static final Probes.Label DISABLED = Probes.label("disabled"); | |
static final java.lang.reflect.Method m = /** some reflection code to lookup method **/ | |
// how to check if a method is disabled in terms of metering | |
if(Probes.name(m).contains(DISABLED)) { /**...**/ } | |
// in simulated environment there is no access to the meta classes so instead use | |
static final Probes.Name NAME = Probes.name("com").name("acme").name("Service").name("doWork") | |
// or alternatively have it parsed | |
static final Probes.Name NAME = Probes.parse("com.acme.Service.doWork") | |
// more efficient checking of disablement | |
if(NAME.contains(DISABLED)) { /**...**/ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment