prometheus/client_java — pull request #26 by matttproud (2014-04-09 08:47:30+00:00)
Title: Use observation buffering w/ new quant. esti.

This commit minimizes the concurrency control overhead that Flavio
reported while exercising a instrumented handled in a tight loop in
synthetic load test. This is achieved by the following:

1. Increasing the default quantile estimator buffer size to minimize
the frequency of its internal compaction. The estimator itself is
not thread safe, so it requires coarse locking around it. The
frequently it internally compacts or requires sample value
producers to wait for it to perform this, the better.

2. Supporting buffering of samples on the client library side in a
low-overhead way that decouples the quantile estimator compaction
from most of the sample value producers.

Providing exact figures from microbenchmarks seems like a specious
enterprise, but it seems likely that this will reduce lock overhead
by minimally 95 percent.