otlpScaleFor

fun otlpScaleFor(relativeAccuracy: Double): Int

The integer OTLP scale whose base equals a DDSketch's bucket growth factor γ = (1+relativeAccuracy)/(1−relativeAccuracy) — the inverse of alphaForOtlpScale.

The derivation is scale = −log₂(log₂ γ), rounded to the nearest integer and verified: if relativeAccuracy was not produced by alphaForOtlpScale (within floating-point tolerance), there is no integer scale and this throws — re-bucketing a mismatched γ onto a power-of-two base would silently break the α guarantee, so kuilt refuses instead.

Throws

if relativeAccuracy does not correspond to an integer OTLP scale; build the sketch with alphaForOtlpScale(scale) instead.