org.glassfish.jersey.server.monitoring
Interface ResponseStatistics


public interface ResponseStatistics

Monitoring statistics of responses produced by application.

Statistics retrieved from Jersey runtime might be mutable and thanks to it might provide inconsistent data as not all statistics are updated in the same time. To retrieve the immutable and consistent statistics data the method snapshot() should be used.

Author:
Miroslav Fuksa (miroslav.fuksa at oracle.com)
See Also:
See monitoring statistics for general details about statistics.

Method Summary
 Integer getLastResponseCode()
          Returns the response code of a last response written by the application.
 Map<Integer,Long> getResponseCodes()
          Returns statistics of response codes produces by the application.
 ResponseStatistics snapshot()
          Get the immutable and consistent snapshot of the monitoring statistics.
 

Method Detail

getLastResponseCode

Integer getLastResponseCode()
Returns the response code of a last response written by the application.

Returns:
Last response status code.

getResponseCodes

Map<Integer,Long> getResponseCodes()
Returns statistics of response codes produces by the application. Keys of a returned map are response status codes and values is the the count of responses with these status count. Values are measured since start of the application.

Returns:
Map with status codes keys and count as values.

snapshot

ResponseStatistics snapshot()
Get the immutable and consistent snapshot of the monitoring statistics. Working with snapshots might have negative performance impact as snapshot must be created but ensures consistency of data over time. However, the usage of snapshot is encouraged to avoid working with inconsistent data. Not all statistics must be updated in the same time on mutable version of statistics.

Returns:
Snapshot of response statistics.


Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.