public class MetricsApplicationEventListener extends Object implements ApplicationEventListener
ApplicationEventListener
which registers
RequestEventListener
for instrumenting Jersey server requests.Constructor and Description |
---|
MetricsApplicationEventListener(io.micrometer.core.instrument.MeterRegistry registry,
JerseyTagsProvider tagsProvider,
String metricName,
boolean autoTimeRequests) |
MetricsApplicationEventListener(io.micrometer.core.instrument.MeterRegistry registry,
JerseyTagsProvider tagsProvider,
String metricName,
boolean autoTimeRequests,
AnnotationFinder annotationFinder) |
Modifier and Type | Method and Description |
---|---|
void |
onEvent(ApplicationEvent event)
Process the application
event . |
RequestEventListener |
onRequest(RequestEvent requestEvent)
Process a new request and return a
request event listener if
listening to request events is required. |
public MetricsApplicationEventListener(io.micrometer.core.instrument.MeterRegistry registry, JerseyTagsProvider tagsProvider, String metricName, boolean autoTimeRequests)
public MetricsApplicationEventListener(io.micrometer.core.instrument.MeterRegistry registry, JerseyTagsProvider tagsProvider, String metricName, boolean autoTimeRequests, AnnotationFinder annotationFinder)
public void onEvent(ApplicationEvent event)
ApplicationEventListener
event
. This method is called when new event occurs.onEvent
in interface ApplicationEventListener
event
- Application event.public RequestEventListener onRequest(RequestEvent requestEvent)
ApplicationEventListener
request event listener
if
listening to request events
is required. The method is called once for
each new incoming request. If listening to the request is required then request event must be returned
from the method. Such a request event listener will receive all request events that one request. If listening
to request event for the request is not required then null
must be returned
from the method (do not return empty mock listener in these
cases as it will have negative performance impact).onRequest
in interface ApplicationEventListener
requestEvent
- Event of type RequestEvent.Type.START
.requestEvent
; null otherwise.Copyright © 2007-2023, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.