Interface ExceptionMapperStatistics
-
- All Known Implementing Classes:
ExceptionMapperStatisticsImpl
public interface ExceptionMapperStatistics
Monitoring statistics ofexception 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 methodsnapshot()
should be used.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.util.Map<java.lang.Class<?>,java.lang.Long>
getExceptionMapperExecutions()
Get the count of exception mapper executions.long
getSuccessfulMappings()
Get count of all successful exception mappings.long
getTotalMappings()
Get count of exception mappings that were performed on exceptions.long
getUnsuccessfulMappings()
Get count of all unsuccessful exception mappings.ExceptionMapperStatistics
snapshot()
Deprecated.implementing class is immutable hence snapshot creation is not needed anymore
-
-
-
Method Detail
-
getExceptionMapperExecutions
java.util.Map<java.lang.Class<?>,java.lang.Long> 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 ExceptionMapperStatistics 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.
-
-