Class MetricsRepositoryMethodInvocationListener

java.lang.Object
org.springframework.boot.actuate.metrics.data.MetricsRepositoryMethodInvocationListener
All Implemented Interfaces:
org.springframework.data.repository.core.support.RepositoryMethodInvocationListener

public class MetricsRepositoryMethodInvocationListener extends Object implements org.springframework.data.repository.core.support.RepositoryMethodInvocationListener
Intercepts Spring Data Repository invocations and records metrics about execution time and results.
Since:
2.5.0
Author:
Phillip Webb
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.data.repository.core.support.RepositoryMethodInvocationListener

    org.springframework.data.repository.core.support.RepositoryMethodInvocationListener.RepositoryMethodInvocation, org.springframework.data.repository.core.support.RepositoryMethodInvocationListener.RepositoryMethodInvocationResult
  • Constructor Summary

    Constructors
    Constructor
    Description
    MetricsRepositoryMethodInvocationListener(Supplier<io.micrometer.core.instrument.MeterRegistry> registrySupplier, RepositoryTagsProvider tagsProvider, String metricName, AutoTimer autoTimer)
    Create a new MetricsRepositoryMethodInvocationListener.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterInvocation(org.springframework.data.repository.core.support.RepositoryMethodInvocationListener.RepositoryMethodInvocation invocation)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MetricsRepositoryMethodInvocationListener

      public MetricsRepositoryMethodInvocationListener(Supplier<io.micrometer.core.instrument.MeterRegistry> registrySupplier, RepositoryTagsProvider tagsProvider, String metricName, AutoTimer autoTimer)
      Create a new MetricsRepositoryMethodInvocationListener.
      Parameters:
      registrySupplier - a supplier for the registry to which metrics are recorded
      tagsProvider - provider for metrics tags
      metricName - name of the metric to record
      autoTimer - the auto-timers to apply or null to disable auto-timing
      Since:
      2.5.4
  • Method Details

    • afterInvocation

      public void afterInvocation(org.springframework.data.repository.core.support.RepositoryMethodInvocationListener.RepositoryMethodInvocation invocation)
      Specified by:
      afterInvocation in interface org.springframework.data.repository.core.support.RepositoryMethodInvocationListener