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
ConstructorDescriptionMetricsRepositoryMethodInvocationListener
(Supplier<io.micrometer.core.instrument.MeterRegistry> registrySupplier, RepositoryTagsProvider tagsProvider, String metricName, AutoTimer autoTimer) Create a newMetricsRepositoryMethodInvocationListener
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterInvocation
(org.springframework.data.repository.core.support.RepositoryMethodInvocationListener.RepositoryMethodInvocation invocation)
-
Constructor Details
-
MetricsRepositoryMethodInvocationListener
public MetricsRepositoryMethodInvocationListener(Supplier<io.micrometer.core.instrument.MeterRegistry> registrySupplier, RepositoryTagsProvider tagsProvider, String metricName, AutoTimer autoTimer) Create a newMetricsRepositoryMethodInvocationListener
.- Parameters:
registrySupplier
- a supplier for the registry to which metrics are recordedtagsProvider
- provider for metrics tagsmetricName
- name of the metric to recordautoTimer
- the auto-timers to apply ornull
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 interfaceorg.springframework.data.repository.core.support.RepositoryMethodInvocationListener
-