REST method execution statistics
Rest-annotated classes get automated timing and error statistic information for all @RestOp and lifecycle-event annotated methods on the class. If you extend from BasicRestServlet or BasicRestObject, then the statics are made available through the REST interface via the following method:
@RestGet(
path="/stats",
summary="Timing statistics",
description="Timing statistics for method invocations on this resource."
)
@Override /* BasicRestOperations */
public RestContextStats getStats(RestRequest req) {
return req.getContext().getStats();
}
Rendered in a browser, it looks like this:
The default REST configuration provides a link to the stats in the navlinks section of the page:
The exception hash shown is the same hash that is shown in the log file and provides a quick way of locating the exception in the logs.
REST interface access to the statistics are provided via the following methods:
Programmatic access to the statistics are provided via the following methods: