A SynchronizedDoubleHistogram is a variant of org. that is
synchronized as a whole, such that queries, copying, and addition operations are atomic with relation to
modification on the SynchronizedDoubleHistogram, nd such that external accessors (e.g. iterations on the
histogram data) that synchronize on the SynchronizedDoubleHistogram instance can safely assume that no
modifications to the histogram data occur within their synchronized block.
It is important to note that synchronization can result in blocking recoding calls. If non-blocking recoding
operations are required, consider using org., or (recommended)
DoubleRecorder which were intended for concurrent operations.
SynchronizedDoubleHistogram supports the recording and analyzing sampled data value counts across a
configurable dynamic range of floating point (double) values, with configurable value precision within the range.
Dynamic range is expressed as a ratio between the highest and lowest non-zero values trackable within the histogram
at any given time. Value precision is expressed as the number of significant [decimal] digits in the value recording,
and provides control over value quantization behavior across the value range and the subsequent value resolution at
any given level.
Auto-ranging: Unlike integer value based histograms, the specific value range tracked by a SynchronizedDoubleHistogram is not specified upfront. Only the dynamic range of values that the histogram can
cover is (optionally) specified. E.g. When a ConcurrentDoubleHistogram is created to track a dynamic range of
3600000000000 (enough to track values from a nanosecond to an hour), values could be recorded into into it in any
consistent unit of time as long as the ratio between the highest and lowest non-zero values stays within the
specified dynamic range, so recording in units of nanoseconds (1.0 thru 3600000000000.0), milliseconds (0.000001
thru 3600000.0) seconds (0.000000001 thru 3600.0), hours (1/3.6E12 thru 1.0) will all work just as well.
Auto-resizing: When constructed with no specified dynamic range (or when auto-resize is turned on with SynchronizedDoubleHistogram#setAutoResize) a SynchronizedDoubleHistogram will auto-resize its dynamic
range to include recorded values as they are encountered. Note that recording calls that cause auto-resizing may
take longer to execute, as resizing incurs allocation and copying of internal data structures.
Attempts to record non-zero values that range outside of the specified dynamic range (or exceed the limits of
of dynamic range when auto-resizing) may results in ArrayIndexOutOfBoundsException exceptions, either
due to overflow or underflow conditions. These exceptions will only be thrown if recording the value would have
resulted in discarding or losing the required value precision of values already recorded in the histogram.
See package description for org. for details.
| Access | Constructor and Description |
|---|---|
| public | SynchronizedDoubleHistogram(final int
Specifies the precision to use. This is the number of significant
decimal digits to which the histogram will maintain value resolution
and separation. Must be a non-negative integer between 0 and 5. numberOfSignificantValueDigits)Construct a new auto-resizing DoubleHistogram using a precision stated as a number of significant decimal digits. |
| public | SynchronizedDoubleHistogram(final long
specifies the dynamic range to use highestToLowestValueRatio, final int Specifies the precision to use. This is the number of significant
decimal digits to which the histogram will maintain value resolution
and separation. Must be a non-negative integer between 0 and 5. numberOfSignificantValueDigits)Construct a new DoubleHistogram with the specified dynamic range (provided in
|
| public | SynchronizedDoubleHistogram(final ConcurrentDoubleHistogram
The source histogram to duplicate source)Construct a |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | add(final DoubleHistogram
The other histogram. fromHistogram)Overrides org. |
| public synchronized void | addWhileCorrectingForCoordinatedOmission(final DoubleHistogram
Other histogram. highestToLowestValueRatio and numberOfSignificantValueDigits must match. fromHistogram, final double If expectedIntervalBetweenValueSamples is larger than 0, add
auto-generated value records as appropriate if value is larger
than expectedIntervalBetweenValueSamples expectedIntervalBetweenValueSamples)Overrides org. |
| public synchronized DoubleHistogram. | allValues()
Overrides org. |
| public synchronized DoubleHistogram | copy()
Overrides org. |
| public synchronized DoubleHistogram | copyCorrectedForCoordinatedOmission(final double
If expectedIntervalBetweenValueSamples is larger than 0, add
auto-generated value records as appropriate if value is larger
than expectedIntervalBetweenValueSamples expectedIntervalBetweenValueSamples)Overrides org. |
| public synchronized void | copyInto(final DoubleHistogram
the histogram to copy into targetHistogram)Overrides org. |
| public synchronized void | copyIntoCorrectedForCoordinatedOmission(final DoubleHistogram
the histogram to copy into targetHistogram, final double If expectedIntervalBetweenValueSamples is larger than 0, add
auto-generated value records as appropriate if value is larger
than expectedIntervalBetweenValueSamples expectedIntervalBetweenValueSamples)Overrides org. |
| public synchronized int | encodeIntoByteBuffer(final ByteBuffer
The buffer to encode into buffer)Overrides org. |
| public synchronized int | encodeIntoCompressedByteBuffer(final ByteBuffer
The buffer to encode into targetBuffer, final int Compression level (for java.util.zip.Deflater). compressionLevel)Overrides org. |
| public synchronized int | encodeIntoCompressedByteBuffer(final ByteBuffer
The buffer to encode into targetBuffer)Overrides org. |
| public synchronized boolean | equals(final Object
the other histogram to compare to other)Overrides org. |
| public synchronized long | getCountAtValue(final double
The value for which to provide the recorded count value)
Get the count of recorded values at a specific value (to within the histogram resolution at the value level).
|
| public synchronized double | getCountBetweenValues(final double
The lower value bound on the range for which
to provide the recorded count. Will be rounded down with
lowValue, final double lowestEquivalentValue.The higher value bound on the range for which to provide the recorded count.
Will be rounded up with highValue)highestEquivalentValue.Overrides org. |
| public synchronized long | getEndTimeStamp()
get the end time stamp [optionally] stored with this histogram
|
| public synchronized int | getEstimatedFootprintInBytes()
Overrides org. |
| public synchronized long | getHighestToLowestValueRatio()
Overrides org. |
| public synchronized double | getIntegerToDoubleValueConversionRatio()
Overrides org. |
| public synchronized double | getMaxValue()
Overrides org. |
| public synchronized double | getMaxValueAsDouble()
Overrides org. |
| public synchronized double | getMean()
Overrides org. |
| public synchronized double | getMinNonZeroValue()
Overrides org. |
| public synchronized double | getMinValue()
Overrides org. |
| public synchronized int | getNeededByteBufferCapacity()
Overrides org. |
| public synchronized int | getNumberOfSignificantValueDigits()
Overrides org. |
| public synchronized double | getPercentileAtOrBelowValue(final double
The value for which to return the associated percentile value)Overrides org. |
| public synchronized long | getStartTimeStamp()
Overrides org. |
| public synchronized double | getStdDeviation()
Get the computed standard deviation of all recorded values in the histogram
|
| public synchronized long | getTotalCount()
Get the total count of all recorded values in the histogram
|
| public synchronized double | getValueAtPercentile(final double
The percentile for which to return the associated value percentile)Overrides org. |
| public synchronized int | hashCode()
Overrides org. |
| public synchronized double | highestEquivalentValue(final double
The given value value)Overrides org. |
| public synchronized boolean | |
| public synchronized DoubleHistogram. | linearBucketValues(final double
The size (in value units) of the linear buckets to use valueUnitsPerBucket)Overrides org. |
| public synchronized DoubleHistogram. | logarithmicBucketValues(final double
The size (in value units) of the first bucket in the iteration valueUnitsInFirstBucket, final double The multiplier by which bucket sizes will grow in each iteration step logBase)Overrides org. |
| public synchronized double | lowestEquivalentValue(final double
The given value value)Overrides org. |
| public synchronized double | medianEquivalentValue(final double
The given value value)Overrides org. |
| public synchronized double | nextNonEquivalentValue(final double
The given value value)Overrides org. |
| public synchronized void | outputPercentileDistribution(final PrintStream
Stream into which the distribution will be output
printStream, final Double The scaling factor by which to divide histogram recorded values units in
output outputValueUnitScalingRatio)Overrides org. |
| public synchronized void | outputPercentileDistribution(final PrintStream
Stream into which the distribution will be output
printStream, final int The number of reporting points per exponentially decreasing half-distance
percentileTicksPerHalfDistance, final Double The scaling factor by which to divide histogram recorded values units in
output outputValueUnitScalingRatio)Overrides org. |
| public synchronized void | outputPercentileDistribution(final PrintStream
Stream into which the distribution will be output
printStream, final int The number of reporting points per exponentially decreasing half-distance
percentileTicksPerHalfDistance, final Double The scaling factor by which to divide histogram recorded values units in
output outputValueUnitScalingRatio, final boolean Output in CSV format if true. Otherwise use plain text form. useCsvFormat)Overrides org. |
| public synchronized DoubleHistogram. | percentiles(final int
The number of iteration steps per half-distance to 100%. percentileTicksPerHalfDistance)Overrides org. |
| public synchronized DoubleHistogram. | recordedValues()
Provide a means of iterating through all recorded histogram values using the finest granularity steps
supported by the underlying representation.
|
| public synchronized void | recordValue(final double
The value to be recorded value)Overrides org. Implements org. |
| public synchronized void | recordValueWithCount(final double
The value to be recorded value, final long The number of occurrences of this value to record count)Overrides org. Implements org. |
| public synchronized void | recordValueWithExpectedInterval(final double
The value to record value, final double If expectedIntervalBetweenValueSamples is larger than 0, add
auto-generated value records as appropriate if value is larger
than expectedIntervalBetweenValueSamples expectedIntervalBetweenValueSamples)Overrides org. Implements org. |
| public synchronized void | reset()
Overrides org. Implements org. |
| public synchronized void | |
| public synchronized void | setEndTimeStamp(final long
the value to set the time stamp to, [by convention] in msec since the epoch. timeStampMsec)
Set the end time stamp value associated with this histogram to a given value.
|
| public synchronized void | setStartTimeStamp(final long
the value to set the time stamp to, [by convention] in msec since the epoch. timeStampMsec)Overrides org. |
| public synchronized double | sizeOfEquivalentValueRange(final double
The given value value)Overrides org. |
| public synchronized void | subtract(final DoubleHistogram
The other histogram. fromHistogram)Overrides org. |
| public synchronized boolean | valuesAreEquivalent(final double
first value to compare value1, final double second value to compare value2)Overrides org. |