Class ExceptionMapperStatisticsImpl

    • Field Detail

      • exceptionMapperExecutionCount

        private final java.util.Map<java.lang.Class<?>,​java.lang.Long> exceptionMapperExecutionCount
      • successfulMappings

        private final long successfulMappings
      • unsuccessfulMappings

        private final long unsuccessfulMappings
      • totalMappings

        private final long totalMappings
    • Constructor Detail

      • ExceptionMapperStatisticsImpl

        private ExceptionMapperStatisticsImpl​(java.util.Map<java.lang.Class<?>,​java.lang.Long> exceptionMapperExecutionCount,
                                              long successfulMappings,
                                              long unsuccessfulMappings,
                                              long totalMappings)
    • Method Detail

      • getExceptionMapperExecutions

        public java.util.Map<java.lang.Class<?>,​java.lang.Long> getExceptionMapperExecutions()
        Description copied from interface: ExceptionMapperStatistics
        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.
        Specified by:
        getExceptionMapperExecutions in interface ExceptionMapperStatistics
        Returns:
        Map with exception mappers as keys and execution count as values.
      • getSuccessfulMappings

        public long getSuccessfulMappings()
        Description copied from interface: ExceptionMapperStatistics
        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).
        Specified by:
        getSuccessfulMappings in interface ExceptionMapperStatistics
        Returns:
        Count of successfully mapped exception.
      • getUnsuccessfulMappings

        public long getUnsuccessfulMappings()
        Description copied from interface: ExceptionMapperStatistics
        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.
        Specified by:
        getUnsuccessfulMappings in interface ExceptionMapperStatistics
        Returns:
        Count of unmapped exception.
      • snapshot

        public ExceptionMapperStatistics snapshot()
        Description copied from interface: ExceptionMapperStatistics
        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.
        Specified by:
        snapshot in interface ExceptionMapperStatistics
        Returns:
        Snapshot of exception mapper statistics.