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

hdr-histogram-js

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hdr-histogram-js

TypeScript port of HdrHistogram

  • 2.0.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is hdr-histogram-js?

The hdr-histogram-js package is a JavaScript implementation of High Dynamic Range (HDR) Histogram, which is designed to offer a fast and accurate way to record and analyze the distribution of measured data points across a wide range with high precision. It is particularly useful for capturing latency and performance data in applications.

What are hdr-histogram-js's main functionalities?

Recording values

This feature allows users to record values into the histogram. It's useful for tracking the distribution of events such as request latencies.

const hdr = require('hdr-histogram-js');
const histogram = hdr.build();
histogram.recordValue(1000);

Retrieving statistics

After recording values, hdr-histogram-js can compute various statistics like percentiles, maximum, and mean values. This is useful for performance analysis and understanding the distribution of your data.

const percentile90 = histogram.getValueAtPercentile(90);
const max = histogram.maxValue;
const mean = histogram.getMean();

Encoding and decoding

hdr-histogram-js supports encoding histograms into a compressed Base64 format and decoding them back. This feature is useful for efficiently transmitting histograms over the network or storing them.

const encodedHistogram = hdr.encodeIntoCompressedBase64(histogram);
const decodedHistogram = hdr.decodeFromCompressedBase64(encodedHistogram);

Other packages similar to hdr-histogram-js

Keywords

FAQs

Package last updated on 28 Dec 2021

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