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
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the response code of a last response written by the application.
    Returns statistics of response codes produces by the application.
    Deprecated.
    implementing class is immutable hence snapshot creation is not needed anymore
  • Method Details

    • 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

      Deprecated.
      implementing class is immutable hence snapshot creation is not needed anymore
      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.