This is a client library for C++ for Prometheus.
This project uses Bazel or CMake to build
- Bazel
apt-get install g++-4.9
or higherapt-get install libicu-dev
for Unicode supportapt-get install libprotobuf-dev protobuf-compiler
for Protocol Buffers
apt-get install libicu-dev
for Unicode supportapt-get install libprotobuf-dev protobuf-compiler
for Protocol Buffers
NOTE: Test execution in CMake has not been implemented.
The Bazel workspace will pull these automatically for you. If you're not using Bazel, you'll need:
- gtest is used in unit tests.
- fake_clock is used in unit tests.
TODO :) This is not quite final yet. You are welcome to use the library but I don't consider it fully stable yet. Contributions (bug reports, pull requests, suggestions) are welcome!
tl;dr: get your own stats by running bazel test prometheus:benchmark_test
.
On my desktop (quad core i5 @3.4GHz), I get the following results:
Test | 1 thread | 10 threads | 100 threads |
---|---|---|---|
Increment a counter 1M times/thread | 23.53ms | 857ms | 8881ms |
Increment gauge 1M times/thread | 23.57ms | 888ms | 8955ms |
Set a gauge 1M times/thread | 22.95ms | 194ms | 1931ms |
Create 10k labels/thread | 6.97ms | 113ms | 1047ms |
Observe 100k values (uniform distribution) in a histogram | 42.69ms | 722ms | 7473ms |
Observe 100k values (exponential distribution) in a histogram | 48.78ms | 783ms | 7849ms |
For full details on what the tests are doing, check out prometheus/benchmark_test.cc
.