resolveStrategyForLength static method
Auto strategy selection shared by every sampler entry point.
Keeping this policy in one place prevents runtime diagnostics and render sampling from drifting when thresholds change.
Implementation
static SamplingStrategy resolveStrategyForLength(
int finiteLength, {
SamplingStrategy? forceStrategy,
}) {
if (forceStrategy != null) return forceStrategy;
return finiteLength <= 5000
? SamplingStrategy.lttb
: finiteLength <= 50000
? SamplingStrategy.minMax
: SamplingStrategy.nth;
}