Class RpcMetrics

java.lang.Object
org.apache.hadoop.ipc.metrics.RpcMetrics

@Private @Metrics(about="Aggregate RPC metrics", context="rpc") public class RpcMetrics extends Object
This class is for maintaining the various RPC statistics and publishing them through the metrics interfaces.
  • Field Details

    • DEFAULT_METRIC_TIME_UNIT

      public static final TimeUnit DEFAULT_METRIC_TIME_UNIT
  • Method Details

    • name

      public String name()
    • create

      public static RpcMetrics create(Server server, Configuration conf)
    • numOpenConnections

      @Metric("Number of open connections") public int numOpenConnections()
    • getNumInProcessHandler

      @Metric("Number of in process handlers") public int getNumInProcessHandler()
    • numOpenConnectionsPerUser

      @Metric("Number of open connections per user") public String numOpenConnectionsPerUser()
    • callQueueLength

      @Metric("Length of the call queue") public int callQueueLength()
    • numDroppedConnections

      @Metric("Number of dropped connections") public long numDroppedConnections()
    • getTotalRequests

      @Metric("Number of total requests") public long getTotalRequests()
    • getTotalRequestsPerSecond

      @Metric("Number of total requests per second") public long getTotalRequestsPerSecond()
    • getMetricsTimeUnit

      public TimeUnit getMetricsTimeUnit()
    • getMetricsTimeUnit

      public static TimeUnit getMetricsTimeUnit(Configuration conf)
    • incrAuthenticationFailures

      public void incrAuthenticationFailures()
      One authentication failure event
    • incrAuthenticationSuccesses

      public void incrAuthenticationSuccesses()
      One authentication success event
    • incrAuthorizationSuccesses

      public void incrAuthorizationSuccesses()
      One authorization success event
    • incrAuthorizationFailures

      public void incrAuthorizationFailures()
      One authorization failure event
    • shutdown

      public void shutdown()
      Shutdown the instrumentation for the process
    • incrSentBytes

      public void incrSentBytes(int count)
      Increment sent bytes by count
      Parameters:
      count - to increment
    • incrReceivedBytes

      public void incrReceivedBytes(int count)
      Increment received bytes by count
      Parameters:
      count - to increment
    • addRpcEnQueueTime

      public void addRpcEnQueueTime(long enQTime)
      Sometimes, the request time observed by the client is much longer than the queue + process time on the RPC server.Perhaps the RPC request 'waiting enQueue' took too long on the RPC server, so we should add enQueue time to RpcMetrics. See HADOOP-18840 for details. Add an RPC enqueue time sample
      Parameters:
      enQTime - the queue time
    • addRpcQueueTime

      public void addRpcQueueTime(long qTime)
      Add an RPC queue time sample
      Parameters:
      qTime - the queue time
    • addRpcLockWaitTime

      public void addRpcLockWaitTime(long waitTime)
    • addRpcProcessingTime

      public void addRpcProcessingTime(long processingTime)
      Add an RPC processing time sample
      Parameters:
      processingTime - the processing time
    • addRpcResponseTime

      public void addRpcResponseTime(long responseTime)
    • addDeferredRpcProcessingTime

      public void addDeferredRpcProcessingTime(long processingTime)
    • incrClientBackoff

      public void incrClientBackoff()
      One client backoff event
    • incrClientBackoffDisconnected

      public void incrClientBackoffDisconnected()
      Client was disconnected due to backoff
    • getClientBackoffDisconnected

      public long getClientBackoffDisconnected()
      Returns the number of disconnected backoffs.
      Returns:
      long
    • incrSlowRpc

      public void incrSlowRpc()
      Increments the Slow RPC counter.
    • incrRequeueCalls

      public void incrRequeueCalls()
      Increments the Requeue Calls counter.
    • incrRpcCallSuccesses

      public void incrRpcCallSuccesses()
      One RPC call success event.
    • getRpcProcessingTime

      public MutableRate getRpcProcessingTime()
      Returns a MutableRate Counter.
      Returns:
      Mutable Rate
    • getProcessingSampleCount

      public long getProcessingSampleCount()
      Returns the number of samples that we have seen so far.
      Returns:
      long
    • getProcessingMean

      public double getProcessingMean()
      Returns mean of RPC Processing Times.
      Returns:
      double
    • getProcessingStdDev

      public double getProcessingStdDev()
      Return Standard Deviation of the Processing Time.
      Returns:
      double
    • getRpcSlowCalls

      public long getRpcSlowCalls()
      Returns the number of slow calls.
      Returns:
      long
    • getRpcRequeueCalls

      @VisibleForTesting public long getRpcRequeueCalls()
      Returns the number of requeue calls.
      Returns:
      long
    • getDeferredRpcProcessingTime

      public MutableRate getDeferredRpcProcessingTime()
    • getDeferredRpcProcessingSampleCount

      public long getDeferredRpcProcessingSampleCount()
    • getDeferredRpcProcessingMean

      public double getDeferredRpcProcessingMean()
    • getDeferredRpcProcessingStdDev

      public double getDeferredRpcProcessingStdDev()
    • getTag

      @VisibleForTesting public MetricsTag getTag(String tagName)
    • getRpcAuthorizationSuccesses

      @VisibleForTesting public MutableCounterLong getRpcAuthorizationSuccesses()