]> git.ipfire.org Git - thirdparty/bind9.git/commit
Simplify histogram quantiles
authorTony Finch <fanf@isc.org>
Mon, 20 Mar 2023 15:05:36 +0000 (15:05 +0000)
committerTony Finch <dot@dotat.at>
Mon, 3 Apr 2023 11:08:05 +0000 (12:08 +0100)
commitcd0e7f853af175d9b1fae8abeb29ea3ca4d33481
treee41371dee45d85de4cfd631d801baec18d649e3b
parentbc2389b8282625d08c44d030769af207d2cce7a8
Simplify histogram quantiles

The `isc_histosummary_t` functions were written in the early days of
`hg64` and carried over when I brought `hg64` into BIND. They were
intended to be useful for graphing cumulative frequency distributions
and the like, but in practice whatever draws charts is better off with
a raw histogram export. Especially because of the poor performance of
the old functions.

The replacement `isc_histo_quantiles()` function is intended for
providing a few quantile values in BIND's stats channel, when the user
does not want the full histogram. Unlike the old functions, the caller
provides all the query fractions up-front, so that the values can be
found in a single scan instead of a scan per value. The scan is from
larger values to smaller, since larger quantiles are usually more
interesting, so the scan can bail out early.
lib/isc/histo.c
lib/isc/include/isc/histo.h
tests/isc/histo_test.c