Interface ExceptionMapperStatistics


public interface ExceptionMapperStatistics
Monitoring statistics of exception mapper executions.

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 Details

    • getExceptionMapperExecutions

      Map<Class<?>,Long> getExceptionMapperExecutions()
      Get the count of exception mapper executions. The returned map contains classes of exception mappers and corresponding execution count as values. One execution of exception mapper is one call of ExceptionMapper.toResponse(Throwable) method.
      Returns:
      Map with exception mappers as keys and execution count as values.
    • getSuccessfulMappings

      long getSuccessfulMappings()
      Get count of all successful exception mappings. Successful exception mapping occurs when any exception mapper returns an valid response (even if response contains non-successful response status code).
      Returns:
      Count of successfully mapped exception.
    • getUnsuccessfulMappings

      long getUnsuccessfulMappings()
      Get count of all unsuccessful exception mappings. Unsuccessful exception mapping occurs when any exception mapping process does not produce an valid response. The reason can be that the exception mapper is not found, or is found but throws exception.
      Returns:
      Count of unmapped exception.
    • getTotalMappings

      long getTotalMappings()
      Get count of exception mappings that were performed on exceptions.
      Returns:
      Count of all exception being mapped in the runtime.
    • snapshot

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