@Retention(value=RUNTIME) @Target(value=METHOD) public @interface PrometheusTimeMethod
Summary with a name specified by the required name parameter, and help
specified by the help parameter.
To properly work, EnablePrometheusTiming must be specified somewhere in your application configuration.
@Controller
public class MyController {
@RequestMapping("/")
@ResponseBody
@PrometheusTimeMethod(name = "my_method_seconds", help = "The number of seconds taken by the main handler")
public Object handleRequest() {
// Each invocation will be timed and recorded.
return database.withCache().get("some_data");
}
}
Copyright © 2018. All rights reserved.