Package com.yahoo.container.jdisc.state
Class MetricSnapshot
- java.lang.Object
-
- com.yahoo.container.jdisc.state.MetricSnapshot
-
- All Implemented Interfaces:
java.lang.Iterable<java.util.Map.Entry<MetricDimensions,MetricSet>>
public final class MetricSnapshot extends java.lang.Object implements java.lang.Iterable<java.util.Map.Entry<MetricDimensions,MetricSet>>
A snapshot of the metrics of this system in a particular time interval.- Author:
- Simon Thoresen Hult
-
-
Constructor Summary
Constructors Constructor Description MetricSnapshot(long from, long to, java.util.concurrent.TimeUnit unit, java.util.Map<MetricDimensions,MetricSet> data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetricSnapshot
createSnapshot()
Create a new snapshot instance where Gauge metrics are preserved with the last-values they have in this snapshot instance.long
getFromTime(java.util.concurrent.TimeUnit unit)
long
getToTime(java.util.concurrent.TimeUnit unit)
java.util.Iterator<java.util.Map.Entry<MetricDimensions,MetricSet>>
iterator()
Returns all the metrics in this snapshot.MetricSet
metricSet(MetricDimensions dim)
Returns a metric set from this snapshot for a given set of dimensions
-
-
-
Constructor Detail
-
MetricSnapshot
public MetricSnapshot(long from, long to, java.util.concurrent.TimeUnit unit, java.util.Map<MetricDimensions,MetricSet> data)
-
-
Method Detail
-
getFromTime
public long getFromTime(java.util.concurrent.TimeUnit unit)
-
getToTime
public long getToTime(java.util.concurrent.TimeUnit unit)
-
iterator
public java.util.Iterator<java.util.Map.Entry<MetricDimensions,MetricSet>> iterator()
Returns all the metrics in this snapshot.- Specified by:
iterator
in interfacejava.lang.Iterable<java.util.Map.Entry<MetricDimensions,MetricSet>>
-
metricSet
public MetricSet metricSet(MetricDimensions dim)
Returns a metric set from this snapshot for a given set of dimensions
-
createSnapshot
public MetricSnapshot createSnapshot()
Create a new snapshot instance where Gauge metrics are preserved with the last-values they have in this snapshot instance.
-
-