Interface ExceptionMapperStatistics
-
public interface ExceptionMapperStatisticsMonitoring statistics ofexception mapperexecutions. 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.- Author:
- Miroslav Fuksa
- See Also:
See monitoring statistics for general details about statistics.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Map<Class<?>,Long>getExceptionMapperExecutions()Get the count of exception mapper executions.longgetSuccessfulMappings()Get count of all successful exception mappings.longgetTotalMappings()Get count of exception mappings that were performed on exceptions.longgetUnsuccessfulMappings()Get count of all unsuccessful exception mappings.ExceptionMapperStatisticssnapshot()Deprecated.implementing class is immutable hence snapshot creation is not needed anymore
-
-
-
Method Detail
-
getExceptionMapperExecutions
Map<Class<?>,Long> getExceptionMapperExecutions()
Get the count of exception mapper executions. The returned map containsclassesofexception mappersand 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 mapperreturns 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 mapperis 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.
-
-