Interface StatisticsCollector

All Known Implementing Classes:
DelegatingStatisticsCollector, NoOpStatisticsCollector, SimpleStatisticsCollector, ThreadLocalStatisticsCollector

@PublicSpi public interface StatisticsCollector
This allows statistics to be collected for DataLoader operations
  • Method Details

    • incrementLoadCount

      default <K> long incrementLoadCount(IncrementLoadCountStatisticsContext<K> context)
      Called to increment the number of loads
      Type Parameters:
      K - the class of the key in the data loader
      Parameters:
      context - the context containing metadata of the data loader invocation
      Returns:
      the current value after increment
    • incrementLoadCount

      @Deprecated long incrementLoadCount()
      Called to increment the number of loads
      Returns:
      the current value after increment
    • incrementLoadErrorCount

      default <K> long incrementLoadErrorCount(IncrementLoadErrorCountStatisticsContext<K> context)
      Called to increment the number of loads that resulted in an object deemed in error
      Type Parameters:
      K - the class of the key in the data loader
      Parameters:
      context - the context containing metadata of the data loader invocation
      Returns:
      the current value after increment
    • incrementLoadErrorCount

      @Deprecated long incrementLoadErrorCount()
      Called to increment the number of loads that resulted in an object deemed in error
      Returns:
      the current value after increment
    • incrementBatchLoadCountBy

      default <K> long incrementBatchLoadCountBy(long delta, IncrementBatchLoadCountByStatisticsContext<K> context)
      Called to increment the number of batch loads
      Type Parameters:
      K - the class of the key in the data loader
      Parameters:
      delta - how much to add to the count
      context - the context containing metadata of the data loader invocation
      Returns:
      the current value after increment
    • incrementBatchLoadCountBy

      @Deprecated long incrementBatchLoadCountBy(long delta)
      Called to increment the number of batch loads
      Parameters:
      delta - how much to add to the count
      Returns:
      the current value after increment
    • incrementBatchLoadExceptionCount

      default <K> long incrementBatchLoadExceptionCount(IncrementBatchLoadExceptionCountStatisticsContext<K> context)
      Called to increment the number of batch loads exceptions
      Type Parameters:
      K - the class of the key in the data loader
      Parameters:
      context - the context containing metadata of the data loader invocation
      Returns:
      the current value after increment
    • incrementBatchLoadExceptionCount

      @Deprecated long incrementBatchLoadExceptionCount()
      Called to increment the number of batch loads exceptions
      Returns:
      the current value after increment
    • incrementCacheHitCount

      default <K> long incrementCacheHitCount(IncrementCacheHitCountStatisticsContext<K> context)
      Called to increment the number of cache hits
      Type Parameters:
      K - the class of the key in the data loader
      Parameters:
      context - the context containing metadata of the data loader invocation
      Returns:
      the current value after increment
    • incrementCacheHitCount

      @Deprecated long incrementCacheHitCount()
      Called to increment the number of cache hits
      Returns:
      the current value after increment
    • getStatistics

      Statistics getStatistics()
      Returns:
      the statistics that have been gathered up to this point in time