Skip to main content

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:

Execution Statistics in Browser

The default REST configuration provides a link to the stats in the navlinks section of the page:

Navigation Links to Stats

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:

BasicRestServletgetStats(RestRequest)BasicRestObjectgetStats(RestRequest)

Programmatic access to the statistics are provided via the following methods:

RestContextgetStats()