@Override public synchronized double getIntegerToDoubleValueConversionRatio() { return super.getIntegerToDoubleValueConversionRatio(); }
/** * Get the lowest recorded value level in the histogram * * @return the Min value recorded in the histogram */ public double getMinValue() { return integerValuesHistogram.getMinValue() * getIntegerToDoubleValueConversionRatio(); }
/** * Get the highest recorded value level in the histogram * * @return the Max value recorded in the histogram */ public double getMaxValue() { return integerValuesHistogram.getMaxValue() * getIntegerToDoubleValueConversionRatio(); }
/** * Get the computed mean value of all recorded values in the histogram * * @return the mean value (in value units) of the histogram data */ public double getMean() { return integerValuesHistogram.getMean() * getIntegerToDoubleValueConversionRatio(); }
/** * Get the lowest recorded non-zero value level in the histogram * * @return the lowest recorded non-zero value level in the histogram */ public double getMinNonZeroValue() { return integerValuesHistogram.getMinNonZeroValue() * getIntegerToDoubleValueConversionRatio(); }
/** * Get the computed standard deviation of all recorded values in the histogram * * @return the standard deviation (in value units) of the histogram data */ public double getStdDeviation() { return integerValuesHistogram.getStdDeviation() * getIntegerToDoubleValueConversionRatio(); }
/** * Get the value at a given percentile. * When the percentile is > 0.0, the value returned is the value that the given the given * percentage of the overall recorded value entries in the histogram are either smaller than * or equivalent to. When the percentile is 0.0, the value returned is the value that all value * entries in the histogram are either larger than or equivalent to. * <p> * Note that two values are "equivalent" in this statement if * {@link org.HdrHistogram.DoubleHistogram#valuesAreEquivalent} would return true. * * @param percentile The percentile for which to return the associated value * @return The value that the given percentage of the overall recorded value entries in the * histogram are either smaller than or equivalent to. When the percentile is 0.0, returns the * value that all value entries in the histogram are either larger than or equivalent to. */ public double getValueAtPercentile(final double percentile) { return integerValuesHistogram.getValueAtPercentile(percentile) * getIntegerToDoubleValueConversionRatio(); }
/** * Produce textual representation of the value distribution of histogram data by percentile. The distribution is * output with exponentially increasing resolution, with each exponentially decreasing half-distance containing * <i>dumpTicksPerHalf</i> percentile reporting tick points. * * @param printStream Stream into which the distribution will be output * <p> * @param percentileTicksPerHalfDistance The number of reporting points per exponentially decreasing half-distance * <p> * @param outputValueUnitScalingRatio The scaling factor by which to divide histogram recorded values units in * output * @param useCsvFormat Output in CSV format if true. Otherwise use plain text form. */ public void outputPercentileDistribution(final PrintStream printStream, final int percentileTicksPerHalfDistance, final Double outputValueUnitScalingRatio, final boolean useCsvFormat) { integerValuesHistogram.outputPercentileDistribution(printStream, percentileTicksPerHalfDistance, outputValueUnitScalingRatio / getIntegerToDoubleValueConversionRatio(), useCsvFormat); }
/** * Get the lowest value that is equivalent to the given value within the histogram's resolution. * Where "equivalent" means that value samples recorded for any two * equivalent values are counted in a common total count. * * @param value The given value * @return The lowest value that is equivalent to the given value within the histogram's resolution. */ public double lowestEquivalentValue(final double value) { return integerValuesHistogram.lowestEquivalentValue((long)(value * getDoubleToIntegerValueConversionRatio())) * getIntegerToDoubleValueConversionRatio(); }
/** * Get the size (in value units) of the range of values that are equivalent to the given value within the * histogram's resolution. Where "equivalent" means that value samples recorded for any two * equivalent values are counted in a common total count. * * @param value The given value * @return The lowest value that is equivalent to the given value within the histogram's resolution. */ public double sizeOfEquivalentValueRange(final double value) { return integerValuesHistogram.sizeOfEquivalentValueRange((long)(value * getDoubleToIntegerValueConversionRatio())) * getIntegerToDoubleValueConversionRatio(); }
/** * Get a value that lies in the middle (rounded up) of the range of values equivalent the given value. * Where "equivalent" means that value samples recorded for any two * equivalent values are counted in a common total count. * * @param value The given value * @return The value lies in the middle (rounded up) of the range of values equivalent the given value. */ public double medianEquivalentValue(final double value) { return integerValuesHistogram.medianEquivalentValue((long)(value * getDoubleToIntegerValueConversionRatio())) * getIntegerToDoubleValueConversionRatio(); }
/** * Get the next value that is not equivalent to the given value within the histogram's resolution. * Where "equivalent" means that value samples recorded for any two * equivalent values are counted in a common total count. * * @param value The given value * @return The next value that is not equivalent to the given value within the histogram's resolution. */ public double nextNonEquivalentValue(final double value) { return integerValuesHistogram.nextNonEquivalentValue((long)(value * getDoubleToIntegerValueConversionRatio())) * getIntegerToDoubleValueConversionRatio(); }
/** * Add the contents of another histogram to this one. * * @param fromHistogram The other histogram. * @throws ArrayIndexOutOfBoundsException (may throw) if values in fromHistogram's cannot be * covered by this histogram's range */ public void add(final DoubleHistogram fromHistogram) throws ArrayIndexOutOfBoundsException { int arrayLength = fromHistogram.integerValuesHistogram.countsArrayLength; AbstractHistogram fromIntegerHistogram = fromHistogram.integerValuesHistogram; for (int i = 0; i < arrayLength; i++) { long count = fromIntegerHistogram.getCountAtIndex(i); if (count > 0) { recordValueWithCount( fromIntegerHistogram.valueFromIndex(i) * fromHistogram.getIntegerToDoubleValueConversionRatio(), count); } } }
/** * Subtract the contents of another histogram from this one. * * @param otherHistogram The other histogram. * @throws ArrayIndexOutOfBoundsException (may throw) if values in fromHistogram's cannot be * covered by this histogram's range */ public void subtract(final DoubleHistogram otherHistogram) { int arrayLength = otherHistogram.integerValuesHistogram.countsArrayLength; AbstractHistogram otherIntegerHistogram = otherHistogram.integerValuesHistogram; for (int i = 0; i < arrayLength; i++) { long otherCount = otherIntegerHistogram.getCountAtIndex(i); if (otherCount > 0) { double otherValue = otherIntegerHistogram.valueFromIndex(i) * otherHistogram.getIntegerToDoubleValueConversionRatio(); if (getCountAtValue(otherValue) < otherCount) { throw new IllegalArgumentException("otherHistogram count (" + otherCount + ") at value " + otherValue + " is larger than this one's (" + getCountAtValue(otherValue) + ")"); } recordValueWithCount(otherValue, -otherCount); } } }
v.getValueIteratedTo() * getIntegerToDoubleValueConversionRatio(), v.getCountAtValueIteratedTo(), expectedIntervalBetweenValueSamples);
getIntegerToDoubleValueConversionRatio() * shiftMultiplier;
getIntegerToDoubleValueConversionRatio() * shiftMultiplier;
@Override protected int doHashCode() { // we cannot use state.hashCode at the moment because of: // https://github.com/HdrHistogram/HdrHistogram/issues/81 // TODO: upgrade the HDRHistogram library return Objects.hash(keyed, Arrays.hashCode(keys), state.getIntegerToDoubleValueConversionRatio(), state.getTotalCount()); } }
/** * Get the size (in value units) of the range of values that are equivalent to the given value within the * histogram's resolution. Where "equivalent" means that value samples recorded for any two * equivalent values are counted in a common total count. * * @param value The given value * @return The lowest value that is equivalent to the given value within the histogram's resolution. */ public double sizeOfEquivalentValueRange(final double value) { return integerValuesHistogram.sizeOfEquivalentValueRange((long)(value * getDoubleToIntegerValueConversionRatio())) * getIntegerToDoubleValueConversionRatio(); }
/** * Get a value that lies in the middle (rounded up) of the range of values equivalent the given value. * Where "equivalent" means that value samples recorded for any two * equivalent values are counted in a common total count. * * @param value The given value * @return The value lies in the middle (rounded up) of the range of values equivalent the given value. */ public double medianEquivalentValue(final double value) { return integerValuesHistogram.medianEquivalentValue((long)(value * getDoubleToIntegerValueConversionRatio())) * getIntegerToDoubleValueConversionRatio(); }