hdr-histogram-percentiles-obj
Install
npm install --save hdr-histogram-percentiles-obj
Usage
const histPercentileObj = const Histogram = const histogram = hdrconst total = 0// record some histogram data...// total++... const result = histPercentileObjconst resultWithPercentiles = histPercentileObjhistPercentileObjpercentiles
API
hdr-histogram-percentiles-obj has two utility functions to use
histAsObj(histogram, total)
histogram
: A hdr-histogram-js object you want to get some values from in a js objecttotal
: the total amount recorded by the histogram, optional
Returns a json object with the min
, max
, average
(mean) and stddev
addPercentiles(histogram, histAsObjResult)
histogram
: A hdr-histogram-js object you want to retrieve the percentiles fromhistAsObjResult
: the result returned whenhistAsObj
is called on some hdr-histogram-js object
Returns the histAsObjResult with the percentiles properties added. Percentile properties are named pNN_DD
, for the NN.DD%
percentile. Eg., the 99th percentile is p99
, while the 99.99th percentile is p99_99
.
percentiles
An array listing the percentiles that hdr-histogram-percentiles-obj adds, as numbers.
Sponsor
Kindly sponsored by nearForm