Class PeriodicHistogramMetricImpl
- java.lang.Object
-
- org.apache.ignite.internal.processors.metric.AbstractMetric
-
- org.apache.ignite.internal.processors.metric.impl.PeriodicHistogramMetricImpl
-
- All Implemented Interfaces:
ConfigurableHistogramMetric,HistogramMetric,Metric,ObjectMetric<long[]>
public class PeriodicHistogramMetricImpl extends AbstractMetric implements ConfigurableHistogramMetric
Histogram to show count of items for each time interval with limited set of intervals. Count of items in interval can be incremented or decremented by timestamp. Items with timestamp below the first interval are moved into "out of bounds interval". Over time new intervals are added and old intervals are merged into "out of bounds interval" to maintain the same total count of intervals.
-
-
Field Summary
Fields Modifier and Type Field Description static intDFLT_BUCKETS_CNTDefault buckets count.static longDFLT_BUCKETS_INTERVALDefault buckets interval in milliseconds.
-
Constructor Summary
Constructors Constructor Description PeriodicHistogramMetricImpl(long startTs, String name, @Nullable String desc)PeriodicHistogramMetricImpl(String name, @Nullable String desc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long[]bounds()voidbounds(long[] bounds)Sets bounds for this histogram.intbucketsCount()Gets buckets count.longbucketsInterval()Gets buckets interval.voiddecrement(long ts)Decrement count of items in interval by timestamp.IgniteBiTuple<long[],long[]>histogram()Gets histogram.voidincrement(long ts)Increment count of items in interval by timestamp.voidreinit(long bucketsInterval, int bucketsCnt)voidreset(long itemsCnt)longstartTs()Gets start timestamp.Class<long[]>type()long[]value()-
Methods inherited from class org.apache.ignite.internal.processors.metric.AbstractMetric
description, equals, hashCode, name
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.spi.metric.Metric
description, name, reset
-
Methods inherited from interface org.apache.ignite.spi.metric.ObjectMetric
getAsString
-
-
-
-
Field Detail
-
DFLT_BUCKETS_INTERVAL
public static final long DFLT_BUCKETS_INTERVAL
Default buckets interval in milliseconds.- See Also:
- Constant Field Values
-
DFLT_BUCKETS_CNT
public static final int DFLT_BUCKETS_CNT
Default buckets count.- See Also:
- Constant Field Values
-
-
Method Detail
-
bounds
public long[] bounds()
- Specified by:
boundsin interfaceHistogramMetric- Returns:
- Bounds of this histogram.
-
bounds
public void bounds(long[] bounds)
Sets bounds for this histogram.- Specified by:
boundsin interfaceConfigurableHistogramMetric
-
value
public long[] value()
- Specified by:
valuein interfaceObjectMetric<long[]>- Returns:
- Value ot the metric.
-
type
public Class<long[]> type()
- Specified by:
typein interfaceObjectMetric<long[]>- Returns:
- Type of metric value.
-
reinit
public void reinit(long bucketsInterval, int bucketsCnt)- Parameters:
bucketsInterval- Buckets interval.bucketsCnt- Buckets count.
-
reset
public void reset(long itemsCnt)
- Parameters:
itemsCnt- Total items count.
-
increment
public void increment(long ts)
Increment count of items in interval by timestamp.
-
decrement
public void decrement(long ts)
Decrement count of items in interval by timestamp.
-
histogram
public IgniteBiTuple<long[],long[]> histogram()
Gets histogram.- Returns:
- Tuple, where first item is array of bounds and second item is array of values. Bounds and values are guaranteed to be consistent.
-
bucketsInterval
public long bucketsInterval()
Gets buckets interval.
-
bucketsCount
public int bucketsCount()
Gets buckets count.
-
startTs
public long startTs()
Gets start timestamp.
-
-