public class MetricsRepositoryMethodInvocationListener
extends java.lang.Object
implements org.springframework.data.repository.core.support.RepositoryMethodInvocationListener
Repository invocations and records metrics about
execution time and results.org.springframework.data.repository.core.support.RepositoryMethodInvocationListener.RepositoryMethodInvocation, org.springframework.data.repository.core.support.RepositoryMethodInvocationListener.RepositoryMethodInvocationResult| Constructor and Description |
|---|
MetricsRepositoryMethodInvocationListener(java.util.function.Supplier<io.micrometer.core.instrument.MeterRegistry> registrySupplier,
RepositoryTagsProvider tagsProvider,
java.lang.String metricName,
AutoTimer autoTimer)
Create a new
MetricsRepositoryMethodInvocationListener. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterInvocation(org.springframework.data.repository.core.support.RepositoryMethodInvocationListener.RepositoryMethodInvocation invocation) |
public MetricsRepositoryMethodInvocationListener(java.util.function.Supplier<io.micrometer.core.instrument.MeterRegistry> registrySupplier,
RepositoryTagsProvider tagsProvider,
java.lang.String metricName,
AutoTimer autoTimer)
MetricsRepositoryMethodInvocationListener.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 or null to disable auto-timingpublic void afterInvocation(org.springframework.data.repository.core.support.RepositoryMethodInvocationListener.RepositoryMethodInvocation invocation)
afterInvocation in interface org.springframework.data.repository.core.support.RepositoryMethodInvocationListener