public class MetricsRepositoryMethodInvocationListener extends 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(io.micrometer.core.instrument.MeterRegistry registry,
RepositoryTagsProvider tagsProvider,
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(io.micrometer.core.instrument.MeterRegistry registry, RepositoryTagsProvider tagsProvider, String metricName, AutoTimer autoTimer)
MetricsRepositoryMethodInvocationListener
.registry
- 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