HdrHistogram_rust icon indicating copy to clipboard operation
HdrHistogram_rust copied to clipboard

Merge multiple Histograms into 1.

Open amrx101 opened this issue 3 years ago • 2 comments

We are going to use this in mqttwrk where in we launch a bunch of clients. We plan to have a Histogram instance for each connection to measure metrics. After that we would like to merge these histograms to get an aggregation of all histograms.

I was looking at Python docs and found something similar. which supports merge of multiple histograms. Our docs dont mention this explicitly. Do we support this feature?

If not, would you be open to PR where we serialise multiple Histograms and send them over a channel and deserialise each of them and merge. Like a fan in? Would take a bit time as I would have to familiarise myself with the code-base.

amrx101 avatar Aug 18 '20 15:08 amrx101

The method you are looking for is Histogram::add (or Histogram::add_corrected) which lets you add one histogram to another :)

If you think this could be clearer in the documentation, a PR that makes it clearer would be great!

jonhoo avatar Aug 18 '20 15:08 jonhoo

@jonhoo

Will send a PR with updated doc.

amrx101 avatar Aug 18 '20 15:08 amrx101