These are chat archives for HdrHistogram/HdrHistogram

19th
May 2015
Flavio W. Brasil
@fwbrasil
May 19 2015 07:25
Hey there, I’d like to know if hrdhistogram is suitable for my use-case. I have multiple instances of a service and each instance will have its own histogram instance, registering the latency locally. A scraping service will collect the data from the instances and aggregate it to show the overall latency of the service. Will the final result be reliable? What would be the transformation to aggregate the multiple results?
thanks in advance for any guidance :)
Darach Ennis
@darach
May 19 2015 08:36
@dreid Sorry, just seeing this now. Suit yourself on how the patch is structured.
Gil Tene
@giltene
May 19 2015 14:37
@febrasil you can use a Recorder (or a SingleWriterRecorder if you know there is only one writer for each) per instance. The scraping service would (at the end of each "period") collect interval histogram from each instance, and add the collected interval histogram together. The sample time will not be exactly the same for all intervals, but each would be lossless (and will not double-count) giving the overall sum the same quality.
@febrasil you can do all this without allocating new histograms at each period by recycling the previous interval histogram when getting an interval. See example use in the jHiccup code.
Gil Tene
@giltene
May 19 2015 14:46
@fwbrasil if you need the "sample time point" to be "the same" for all instances for some reason and this is all done in one process, you can build your own multi-instance variant of Recorder, which would track an array of interval histograms and sample ("flip") the whole array together. But if you use the recycling call form and delay any histogram adds until all intervals are gotten, your overall flip will be very quick (no allocation, and no operations on the inside of any histograms).