blob: 72a8f2b8941ce0876c9a7d1b5012d26abbc4c146 [file] [log] [blame]
<!--
/***************************************************************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
***************************************************************************************************************************/
-->
{8.1.3-new}
REST method execution statistics
<p>
<ja>@RestResource</ja> annotated classes get automated timing and error statistic information for all <ja>@RestMethod</ja>
and <ja>@RestHook</ja> annotated methods on the class.
</p>
<p>
The statistics are made available via the subpath <c>/stats</c> as shown below in the <c>HelloWorldResource</c> example:
</p>
<img class='bordered w900' src='doc-files/juneau-rest-server.ExecutionStatistics.1.png'>
<p>
The default REST configuration provides a link to the stats in the navlinks section of the page:
</p>
<img class='bordered w900' src='doc-files/juneau-rest-server.ExecutionStatistics.2.png'>
<p>
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.
</p>
<p>
Programmatic access to the statistics are provided via the following methods:
</p>
<ul class='javatree'>
<li class='jc'>{@link oajr.RestContext}
<ul>
<li class='jm'>{@link oajr.RestContext#getStats() getStats()}
<li class='jm'>{@link oajr.RestContext#getMethodExecStats() getMethodExecStats()}
<li class='jm'>{@link oajr.RestContext#getMethodExecStatsReport() getMethodExecStatsReport()}
</ul>
</ul>