@ThreadSafe @ParametersAreNonnullByDefault public final class QuantizedAccumulator extends AbstractMeasurementAccumulator
Constructor and Description |
---|
QuantizedAccumulator(Object measuredEntity,
String description,
String unitOfMeasurement,
int factor,
int lowerMagnitude,
int higherMagnitude,
int quantasPerMagnitude)
Create a quantized accumulator.
|
Modifier and Type | Method and Description |
---|---|
MeasurementAccumulator |
aggregate(MeasurementAccumulator mSource) |
QuantizedAccumulator |
createClone() |
MeasurementAccumulator |
createLike(Object entity) |
long[] |
get() |
MeasurementsInfo |
getInfo() |
long |
getMaxMeasurement() |
long |
getMeasurementCount() |
long |
getMeasurementTotal() |
long |
getMinMeasurement() |
long[] |
getQuatizedMeasurements() |
long[] |
getThenReset() |
String |
getUnitOfMeasurement() |
void |
record(long measurement)
record a measurement for current time.
|
QuantizedAccumulator |
reset()
reset this entity.
|
String |
toString() |
getMaxTime, getMinTime, recordAt
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCompositeData
public QuantizedAccumulator(Object measuredEntity, String description, String unitOfMeasurement, int factor, int lowerMagnitude, int higherMagnitude, int quantasPerMagnitude)
measuredEntity
- - and object representing the thing we accumulate measurements for.description
- - description of the thing we accumulate measurements for.unitOfMeasurement
- - unit of measurement.factor
- lowerMagnitude
- the lower end of the quantized recording (lowerMagnitude/lowerMagnitude) * factor ^
|lowerMagnitude|higherMagnitude
- the higher end of the quantized recording (higherMagnitude/higherMagnitude) * factor ^
|higherMagnitude|quantasPerMagnitude
- number of buckets / magnitudepublic String getUnitOfMeasurement()
public void record(long measurement)
MeasurementRecorder
measurement
- the measurement value@Nullable public long[] get()
public MeasurementsInfo getInfo()
public MeasurementAccumulator aggregate(MeasurementAccumulator mSource)
public QuantizedAccumulator createClone()
@Nullable public QuantizedAccumulator reset()
MeasurementAccumulator
public long getMaxMeasurement()
public long getMeasurementCount()
public long getMeasurementTotal()
public long getMinMeasurement()
public long[] getQuatizedMeasurements()
public MeasurementAccumulator createLike(Object entity)
@Nullable public long[] getThenReset()
Copyright © 2018 SPF4J. All rights reserved.