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

monti-apm-sketches-js

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monti-apm-sketches-js

An Implementation Of DDSketch, A Fast and Fully-Mergeable Quantile Sketch with Relative-Error Guarantees.

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29
decreased by-32.56%
Maintainers
1
Weekly downloads
 
Created
Source

sketches-js

Fork of sketches-js to fix compatibility with older versions of Node.

An implementation of DDSketch for Node.js.

DDSketch is a data structure for recording large amounts of numeric data and calculating quantiles over that data. It's designed to be fast, fully-mergeable and provide guarantees that a quantile value is within a configurable percentage threshold of the real value.

Implementation

The implementation is based on the official paper: DDSketch: A Fast and Fully-Mergeable Quantile Sketch with Relative-Error Guarantees (PDF)

Usage

npm install monti-apm-sketches-js
const { DDSketch } = require('sketches-js');

const sketch = new DDSketch({
  alpha: 0.005 // compute quantiles with precision of 1/2 of a percent
});

for (let i = 0; i < 1000; i++) {
  sketch.add(Math.random() * 1000);
}

[0.5, 0.75, 0.9, 0.95, 0.99].forEach(function(q) {
  console.log(`p${q * 100}: ${sketch.quantile(q)}`);
});

License

The source code is distributed under the terms of MPL 2.0 license.

Keywords

FAQs

Package last updated on 05 Aug 2020

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