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 Summary
Modifier and TypeMethodDescriptionGet the count of exception mapper executions.long
Get count of all successful exception mappings.long
Get count of exception mappings that were performed on exceptions.long
Get count of all unsuccessful exception mappings.snapshot()
Deprecated.implementing class is immutable hence snapshot creation is not needed anymore
-
Method Details
-
getExceptionMapperExecutions
Get the count of exception mapper executions. The returned map containsclasses
ofexception mappers
and corresponding execution count as values. One execution of exception mapper is one call ofExceptionMapper.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 anyexception 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 theexception 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 anymoreGet 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.
-