Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hdr-histogram-percentiles-obj

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hdr-histogram-percentiles-obj

A little lib for turning native-hdr-histograms to objects

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
619K
decreased by-49.13%
Maintainers
1
Weekly downloads
 
Created
Source

hdr-histogram-percentiles-obj

Install

npm install --save hdr-histogram-percentiles-obj

Usage

const histPercentileObj = require('hdr-histogram-percentiles-obj')
const Histogram = require('native-hdr-histogram')

const histogram = new Histogram(1, 100)
const total = 0
// record some histogram data...
// total++...

const result = histPercentileObj.histAsObj(histogram, total)
const resultWithPercentiles = histPercentileObj.addPercentiles(histogram, histPercentileObj.histAsObj(histogram, total))

API

hdr-histogram-percentiles-obj has two utility functions to use

histAsObj(histogram, total)

  • histogram: A native-hdr-histogram object you want to get some values from in a js object
  • total: 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 native-hdr-histogram object you want to retrieve the percentiles from
  • histAsObjResult: the result returned when histAsObj is called on some native-hdr-histogram object

Returns the histAsObjResult with the percentiles properties added

Sponsor

Kindly sponsored by nearForm

License

MIT

Keywords

FAQs

Package last updated on 15 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc