Skip to content

Commit 61b6c1a

Browse files
authored
Merge pull request #47 from prometheus/beorn7/histogram
Switch to base 2 and powers of 2 for resolution
2 parents 8831f0d + bbaf1cc commit 61b6c1a

2 files changed

Lines changed: 69 additions & 59 deletions

File tree

go/metrics.pb.go

Lines changed: 63 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

io/prometheus/client/metrics.proto

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ message Histogram {
6161
optional double sample_sum = 2;
6262
repeated Bucket bucket = 3; // Ordered in increasing order of upper_bound, +Inf bucket is optional.
6363
// Sparse bucket (sb) stuff:
64-
optional uint32 sb_resolution = 4; // That many buckets per power of ten. Must be <256. Zero for no sparse buckets.
64+
// The sb_schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8.
65+
// They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and
66+
// then each power of two is divided into 2^n logarithmic buckets.
67+
// Or in other words, each bucket boundary is the previous boundary times 2^(2^-n).
68+
// In the future, more bucket schemas may be added using numbers < -4 or > 8.
69+
optional sint32 sb_schema = 4;
6570
optional double sb_zero_threshold = 5; // Breadth of the zero bucket.
6671
optional uint64 sb_zero_count = 6; // Count in zero bucket.
6772
optional SparseBuckets sb_negative = 7; // Negative sparse buckets.

0 commit comments

Comments
 (0)