Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
streaming-percentiles
Advanced tools
This is a reusable JavaScript library with implementations of various percentile algorithms on streams of data. These algorithms all calculate only approximate percentiles, not exact percentiles.
For more on streaming percentiles, see Calculating Percentiles on Streaming Data.
If you use NPM, npm install streaming-percentiles
. Otherwise,
download the latest release
binaries
or the latest release source
code.
You can also load directly from
unpkg.com.
For convenience, you can also use the latest release binaries directly from a web browser:
<script src="//sengelha.github.io/streaming-percentiles-js/streamingPercentiles.v1.min.js"></script>
<script>
var gk = new streamingPercentiles.GK(0.1);
...
</script>
Here's a simple example on how to use the Greenwald-Khanna streaming percentile algorithm:
var sp = require('streaming-percentiles');
// epsilon is allowable error. As epsilon becomes smaller, the
// accuracy of the approximations improves, but the class consumes
// more memory.
var epsilon = 0.1;
var gk = new sp.GK(epsilon);
for (var i = 0; i < 1000; ++i)
gk.insert(Math.random());
var p50 = gk.quantile(0.5); // Approx. median
var p95 = gk.quantile(0.95); // Approx. 95th percentile
Construct an object which implements the Greenwald-Khanna streaming percentile algorithm with allowable error epsilon.
Example:
var sp = require('streaming-percentiles');
var gk = new sp.GK(0.1);
Logs the observation of a value.
Example:
gk.insert(Math.random());
Compute the approximate quantile at phi. For example, the 95th percentile corresponds to phi = 0.95.
Example:
var p50 = gk.quantile(0.5);
This project is licensed under the MIT License.
1.0.0 - 2018-03-09
Initial release. Supports the Greenwald-Khanna algorithm.
FAQs
Implementations of various streaming percentile algorithms
The npm package streaming-percentiles receives a total of 130 weekly downloads. As such, streaming-percentiles popularity was classified as not popular.
We found that streaming-percentiles demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.