Oak has an optional dependency on dropwizard metric library which has a Histogram implementation [1] which can be used.
So possibly we can use that. So far its optional and hidden behind the statistics api. Recently I also had to make use of that for rate estimation in indexing so used it in a way that Metrics based logic gets used if avialable otherwise fallback to a simple mean based implementation [2]. May be we can make it a required dependency? Chetan Mehrotra [1] http://metrics.dropwizard.io/3.1.0/apidocs/com/codahale/metrics/Histogram.html [2] https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/progress/MetricRateEstimator.java On Tue, Jul 4, 2017 at 2:22 PM, Andrei Dulceanu <andrei.dulce...@gmail.com> wrote: > Hi all, > > I was working on an issue for which I needed to use *only* a percentile for > some recorded stats. Initially I used SynchronizedDescriptiveStatistics [0] > from commons-math3 [1], but then I thought that adding this dependency > would be too much for such a simple use case. > > Now my question is this: do we have a simple percentile implementation in > Oak (I didn't find one)? If not, would you recommend writing my own or > adapting/extracting an existing one in a utility class? > > Regards, > Andrei > > [0] > http://commons.apache.org/proper/commons-math/javadocs/api-3.3/org/apache/commons/math3/stat/descriptive/SynchronizedDescriptiveStatistics.html > [1] http://commons.apache.org/proper/commons-math/