From bc86c725a6a7c86b7fee67ffd6c3f539199661d1 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 3 Oct 2019 18:06:09 +0100 Subject: [PATCH] Added exponential bucket generation explaination for histograms into the readme. --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 03e9e75..6731fe1 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,20 @@ $renderer = new RenderTextFormat(); $result = $renderer->render($registry->getMetricFamilySamples()); ``` +### Advanced Usage + +#### Advanced Histogram Usage +On passing an empty array for the bucket parameter on instantiation, a set of default buckets will be used instead. +Whilst this is a good base for a typical web application, there is named constructor to assist in the generation of +exponential / geometric buckets. + +Eg: +``` +Histogram::exponentialBuckets(0.05, 1.5, 10); +``` + +This will start your buckets with a value of 1.5, grow them by a factor of 1.5 per bucket across a set of 10 buckets. + Also look at the [examples](examples). ## Development