## org.apache.hadoop.ipc.metrics
Class RpcInstrumentation

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

All Implemented Interfaces:
  MetricsSource

    public class RpcInstrumentation

extends Object
implements MetricsSource

The RPC metrics instrumentation

Nested Class Summary
`static class` `RpcInstrumentation.Detailed` Use a separate source for detailed (per call) RPC metrics for easy and efficient filtering

Method Summary
`void` `addRpcProcessingTime(int processingTime)` Add an RPC processing time sample
`void` `addRpcProcessingTime(String methodName, int processingTime)` Add an RPC processing time sample for a particular RPC method
`void` `addRpcQueueTime(int qTime)` Add an RPC queue time sample
`static RpcInstrumentation` `create(String serverName, int port)` Create an RPC instrumentation object
`static RpcInstrumentation` `create(String serverName, int port, MetricsSystem ms)` Create an RPC instrumentation object Mostly useful for testing.
`MetricsSource` `detailed()`
`void` `getMetrics(MetricsBuilder builder, boolean all)` Get metrics from the source
`void` `incrAuthenticationFailures()` One authentication failure event
`void` `incrAuthenticationSuccesses()` One authentication success event
`void` `incrAuthorizationFailures()` One authorization failure event
`void` `incrAuthorizationSuccesses()` One authorization success event
`void` `incrReceivedBytes(int count)` Increment received bytes by count
`void` `incrSentBytes(int count)` Increment sent bytes by count
`void` `shutdown()` Shutdown the instrumentation for the process

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getMetrics

    public void getMetrics(MetricsBuilder builder,
                           boolean all)

  Description copied from interface: `MetricsSource`
  Get metrics from the source

  Specified by:
    `getMetrics` in interface `MetricsSource`
  Parameters:
    `builder` - to contain the resulting metrics snapshot
    `all` - if true, return all metrics even if unchanged.

### create

    public static RpcInstrumentation create(String serverName,
                                            int port)

  Create an RPC instrumentation object

  Parameters:
    `serverName` - name of the server
    `port` - the RPC port
  Returns:
    the instrumentation object

### create

    public static RpcInstrumentation create(String serverName,
                                            int port,
                                            MetricsSystem ms)

  Create an RPC instrumentation object Mostly useful for testing.

  Parameters:
    `serverName` - name of the server
    `port` - the RPC port
    `ms` - the metrics system object
  Returns:
    the instrumentation object

### detailed

    public MetricsSource detailed()

  Returns:
    the detailed (per call) metrics source for RPC

### 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

### addRpcQueueTime

    public void addRpcQueueTime(int qTime)

  Add an RPC queue time sample

  Parameters:
    `qTime` -

### addRpcProcessingTime

    public void addRpcProcessingTime(int processingTime)

  Add an RPC processing time sample

  Parameters:
    `processingTime` -

### addRpcProcessingTime

    public void addRpcProcessingTime(String methodName,
                                     int processingTime)

  Add an RPC processing time sample for a particular RPC method

  Parameters:
    `methodName` - method name of the RPC
    `processingTime` - elapsed processing time of the RPC

Copyright © 2009 The Apache Software Foundation