Package com.github.ambry.rest
Class RestRequestMetricsTracker.NioMetricsTracker
- java.lang.Object
-
- com.github.ambry.rest.RestRequestMetricsTracker.NioMetricsTracker
-
- Enclosing class:
- RestRequestMetricsTracker
public static class RestRequestMetricsTracker.NioMetricsTracker extends java.lang.Object
Tracker for updating NIO related metrics. These are usually updated in classes implemented by theNioServer
framework (e.g. Implementations ofRestRequest
,RestResponseChannel
or any other classes that form a part of the framework).
-
-
Constructor Summary
Constructors Constructor Description NioMetricsTracker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
addToRequestProcessingTime(long delta)
Adds to the time taken to process the request at the NIO layer.long
addToResponseProcessingTime(long delta)
Adds to the time taken to process the response at the NIO layer.void
markFirstByteSent()
Marks the time at which the first byte of the response is sent.void
markRequestCompleted()
Marks the time at which request was completed so that request RTT can be calculated.void
markRequestReceived()
Marks the time at which the request was received.
-
-
-
Method Detail
-
addToRequestProcessingTime
public long addToRequestProcessingTime(long delta)
Adds to the time taken to process the request at the NIO layer.- Parameters:
delta
- the time taken in ms to do the current piece of processing at the NIO layer for the request.- Returns:
- the total time taken in ms to process the request at the NIO layer, including the current piece, at this moment.
-
addToResponseProcessingTime
public long addToResponseProcessingTime(long delta)
Adds to the time taken to process the response at the NIO layer.- Parameters:
delta
- the time taken in ms to do the current piece of processing at the NIO layer for the response.- Returns:
- the total time taken in ms to process the response at the NIO layer, including the current piece, at this moment.
-
markRequestReceived
public void markRequestReceived()
Marks the time at which the request was received.
-
markFirstByteSent
public void markFirstByteSent()
Marks the time at which the first byte of the response is sent.
-
markRequestCompleted
public void markRequestCompleted()
Marks the time at which request was completed so that request RTT can be calculated.
-
-