Class 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 the NioServer framework (e.g. Implementations of RestRequest, RestResponseChannel or any other classes that form a part of the framework).
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NioMetricsTracker

        public NioMetricsTracker()
    • 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.