org.apache.cassandra.metrics

## Class LatencyMetrics

- java.lang.Object
- - org.apache.cassandra.metrics.LatencyMetrics

Direct Known Subclasses:
  ClientRequestMetrics

    public class LatencyMetrics
    extends java.lang.Object

Metrics about latencies

### Field Summary

Fields
`protected MetricNameFactory` `factory`
`protected long` `lastLatency`
`protected long` `lastOpCount`
`com.yammer.metrics.core.Timer` `latency` Latency
`protected java.lang.String` `namePrefix`
`EstimatedHistogram` `recentLatencyHistogram` Deprecated.
`com.yammer.metrics.core.Counter` `totalLatency` Total latency in micro sec
`EstimatedHistogram` `totalLatencyHistogram` Deprecated.

### Constructor Summary

Constructors
Constructor and Description
`LatencyMetrics(MetricNameFactory factory, java.lang.String namePrefix)` Create LatencyMetrics with given group, type, prefix to append to each metric name, and scope.
`LatencyMetrics(java.lang.String type, java.lang.String scope)` Create LatencyMetrics with given group, type, and scope.
`LatencyMetrics(java.lang.String type, java.lang.String namePrefix, java.lang.String scope)` Create LatencyMetrics with given group, type, prefix to append to each metric name, and scope.

### Method Summary

Methods
`void` `addNano(long nanos)` takes nanoseconds
`double` `getRecentLatency()` Deprecated.
`void` `release()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### latency

    public final com.yammer.metrics.core.Timer latency

Latency

#### totalLatency

    public final com.yammer.metrics.core.Counter totalLatency

Total latency in micro sec

#### factory

    protected final MetricNameFactory factory

#### namePrefix

    protected final java.lang.String namePrefix

#### totalLatencyHistogram

    @Deprecated
    public final EstimatedHistogram totalLatencyHistogram

Deprecated.

#### recentLatencyHistogram

    @Deprecated
    public final EstimatedHistogram recentLatencyHistogram

Deprecated.

#### lastLatency

    protected long lastLatency

#### lastOpCount

    protected long lastOpCount

### Constructor Detail

#### LatencyMetrics

    public LatencyMetrics(java.lang.String type,
                  java.lang.String scope)

Create LatencyMetrics with given group, type, and scope. Name prefix for each metric will be empty.

Parameters:
  `type` - Type name
  `scope` - Scope

#### LatencyMetrics

    public LatencyMetrics(java.lang.String type,
                  java.lang.String namePrefix,
                  java.lang.String scope)

Create LatencyMetrics with given group, type, prefix to append to each metric name, and scope.

Parameters:
  `type` - Type name
  `namePrefix` - Prefix to append to each metric name
  `scope` - Scope of metrics

#### LatencyMetrics

    public LatencyMetrics(MetricNameFactory factory,
                  java.lang.String namePrefix)

Create LatencyMetrics with given group, type, prefix to append to each metric name, and scope.

Parameters:
  `factory` - MetricName factory to use
  `namePrefix` - Prefix to append to each metric name

### Method Detail

#### addNano

    public void addNano(long nanos)

takes nanoseconds

#### release

    public void release()

#### getRecentLatency

    @Deprecated
    public double getRecentLatency()

Deprecated.