com.twitter.common.metrics
Interface MetricRegistry

All Known Implementing Classes:
Metrics, ScopedMetrics

public interface MetricRegistry

A registry that maintains a collection of metrics.


Method Summary
<T extends Number>
void
register(Gauge<T> gauge)
          Registers a new gauge.
 AtomicLong registerLong(String name)
          Creates a gauge and returns an AtomicLong that can be modified to update the value.
 MetricRegistry scope(String name)
          Returns or creates a sub-scope of this metric registry.
 

Method Detail

scope

MetricRegistry scope(String name)
Returns or creates a sub-scope of this metric registry.

Parameters:
name - Name for the sub-scope.
Returns:
A possibly-new metric registry, whose metrics will be 'children' of this scope.

register

<T extends Number> void register(Gauge<T> gauge)
Registers a new gauge.

Type Parameters:
T - Number type of the gauge's values.
Parameters:
gauge - Gauge to register.

registerLong

AtomicLong registerLong(String name)
Creates a gauge and returns an AtomicLong that can be modified to update the value.

Parameters:
name - Name to associate with the gauge.
Returns:
Handle to modify the gauge value.