• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

d4rkr00t / percentile / 351
100%

Build:
DEFAULT BRANCH: master
Ran 24 Apr 2020 07:27AM UTC
Jobs 3
Files 1
Run time 35s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
351

push

travis-ci

d4rkr00t
feat: Support an array of percentiles

Add support for calcualting and array of percentiles in 1 pass, example:

```js
const percentile = require("percentile");
const result = percentile(
  [70, 80, 90], // calculates 70p, 80p and 90p in one pass
  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
);
console.log(result); // [7, 8, 9]
```

It adds a little bit of overhead because, now percentile needs to
convert a percentile argument to an array and apply validation and
calculation to this array of percentiles, but overall performance is
still in a ball park of original implementation:

```
Small Array – 10 items [old] x 3,024,685 ops/sec ±0.65% (94 runs sampled)
Small Array – 10 items [new] x 2,941,058 ops/sec ±1.04% (95 runs sampled)
Fastest is Small Array – 10 items [old]

Big array 10k values [old] x 5,482 ops/sec ±0.58% (92 runs sampled)
Big array 10k values [new] x 5,381 ops/sec ±0.69% (91 runs sampled)
Fastest is Big array 10k values [old]

Big array 100k values [old] x 395 ops/sec ±1.00% (91 runs sampled)
Big array 100k values [new] x 406 ops/sec ±0.93% (88 runs sampled)
Fastest is Big array 100k values [new]
```

Fixes #101

24 of 24 branches covered (100.0%)

32 of 32 relevant lines covered (100.0%)

4577.19 hits per line

Jobs
ID Job ID Ran Files Coverage
1 351.1 24 Apr 2020 07:27AM UTC 0
100.0
Travis Job 351.1
2 351.2 24 Apr 2020 07:27AM UTC 0
100.0
Travis Job 351.2
3 351.3 24 Apr 2020 07:27AM UTC 0
100.0
Travis Job 351.3
Source Files on build 351
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #351
  • 179a0273 on github
  • Prev Build on master (#349)
  • Next Build on master (#352)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc