@FunctionalInterface public interface ServiceCallInstrumentation
Modifier and Type | Field and Description |
---|---|
static long |
NS_IN_MILLIS
Handy constant for calculating MS duration.
|
Modifier and Type | Method and Description |
---|---|
void |
onComplete(double duration,
PServiceCall call,
PServiceCall reply)
After each service call this method is called with the duration, call and
response objects.
|
default void |
onTransportException(Exception e,
double duration,
PServiceCall call,
PServiceCall reply)
Called when the service call failed in the transport layer itself with something
not related to the actual service call.
|
static final long NS_IN_MILLIS
void onComplete(double duration, @Nullable PServiceCall call, @Nullable PServiceCall reply)
Note that the timing may not include the whole stack time since receiving
the first packet, that is dependent on the specific implementation and the
limitations there. E.g. it does not include the time receiving the first
HTTP packet with the headers, or waiting for free worker threads when using
ProvidenceServlet
.
duration
- The duration of handling the service call in milliseconds,
including receiving and sending it.call
- The call triggered.reply
- The reply returned.default void onTransportException(Exception e, double duration, @Nullable PServiceCall call, @Nullable PServiceCall reply)
onComplete(double, PServiceCall, PServiceCall)
will NOT be called after the exception call, but will be chained if this method
has no override.e
- The exception thrown.duration
- The duration of handling the service call in milliseconds,
including receiving and sending it.call
- The service call.reply
- The service reply.Copyright © 2015–2017 morimekta.net. All rights reserved.