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

apache / bookkeeper / 22
72%

Build:
DEFAULT BRANCH: master
Ran 15 Mar 2018 02:56PM UTC
Jobs 1
Files 397
Run time 48s
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
22

push

jenkins

Sijie Guo
Collect Prometheus latency stats using DataSketches

The implementation for collecting and estimating the latency quantiles in the Prometheus Java client library is very slow and it is impacting the the bookie performance.

I have added a micro-benchmark that tests our various stats providers. These tests are simulating 16 concurrent threads updating the stats.

#### Counter increment
```
Benchmark                              (statsProvider)   Mode  Cnt    Score      Error   Units
StatsLoggerBenchmark.counterIncrement       Prometheus  thrpt    3  391.882 ±  786.987  ops/us
StatsLoggerBenchmark.counterIncrement         Codahale  thrpt    3  449.341 ± 1337.736  ops/us
StatsLoggerBenchmark.counterIncrement          Twitter  thrpt    3   43.354 ±    9.331  ops/us
StatsLoggerBenchmark.counterIncrement          Ostrich  thrpt    3   43.790 ±    1.332  ops/us
```

Here prometheus is fast, though not as fast as a simple `LongAdder` which can reach ~500M ops/sec.

#### Latency quantiles

```
Benchmark                              (statsProvider)   Mode  Cnt    Score      Error   Units
StatsLoggerBenchmark.recordLatency          Prometheus  thrpt    3    0.255 ±    0.667  ops/us
StatsLoggerBenchmark.recordLatency            Codahale  thrpt    3    4.963 ±    1.671  ops/us
StatsLoggerBenchmark.recordLatency             Twitter  thrpt    3    4.793 ±    0.766  ops/us
StatsLoggerBenchmark.recordLatency             Ostrich  thrpt    3    2.473 ±    6.394  ops/us
```

Here is where Prometheus is super-slow: 250K ops/second max, mostly due to contention and GC pressure.

## Modification

I have re-adapted a stats collector I had done in the Yahoo branch:
https://github.com/yahoo/bookkeeper/tree/yahoo-4.3/bookkeeper-stats-providers/datasketches-metrics-provider/src/main/java/org/apache/bokkeeper/stats/datasketches

This is based on the [DataSketches](https://datasketches.github.io/) library to have very fast and lightweight quantile estimates (along with a number of... (continued)

22822 of 31627 relevant lines covered (72.16%)

0.72 hits per line

Jobs
ID Job ID Ran Files Coverage
1 22.1 15 Mar 2018 02:56PM UTC 0
72.16
Source Files on build 22
Detailed source file information is not available for this build.
  • Back to Repo
  • Jenkins Build #22
  • 3bff1995 on github
  • Prev Build on master (#21)
  • Next Build on master (#23)
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

© 2026 Coveralls, Inc