A native histogram, also known as a sparse histogram. Original design doc: https://docs.google.com/document/d/1cLNv3aufPZb3fNfaJgdaRBZsInZKKIHo9E6HinJVbpM/edit The appendix of this design doc also explains the concept of float histograms. This Histogram message can represent both, the usual integer
| 1005 | // histograms. This Histogram message can represent both, the usual |
| 1006 | // integer histogram as well as a float histogram. |
| 1007 | type Histogram struct { |
| 1008 | // Types that are valid to be assigned to Count: |
| 1009 | // |
| 1010 | // *Histogram_CountInt |
| 1011 | // *Histogram_CountFloat |
| 1012 | Count isHistogram_Count `protobuf_oneof:"count"` |
| 1013 | Sum float64 `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` |
| 1014 | // The schema defines the bucket schema. Currently, valid numbers |
| 1015 | // are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1 |
| 1016 | // is a bucket boundary in each case, and then each power of two is |
| 1017 | // divided into 2^n logarithmic buckets. Or in other words, each |
| 1018 | // bucket boundary is the previous boundary times 2^(2^-n). In the |
| 1019 | // future, more bucket schemas may be added using numbers < -4 or > |
| 1020 | // 8. |
| 1021 | Schema int32 `protobuf:"zigzag32,4,opt,name=schema,proto3" json:"schema,omitempty"` |
| 1022 | ZeroThreshold float64 `protobuf:"fixed64,5,opt,name=zero_threshold,json=zeroThreshold,proto3" json:"zero_threshold,omitempty"` |
| 1023 | // Types that are valid to be assigned to ZeroCount: |
| 1024 | // |
| 1025 | // *Histogram_ZeroCountInt |
| 1026 | // *Histogram_ZeroCountFloat |
| 1027 | ZeroCount isHistogram_ZeroCount `protobuf_oneof:"zero_count"` |
| 1028 | // Negative Buckets. |
| 1029 | NegativeSpans []BucketSpan `protobuf:"bytes,8,rep,name=negative_spans,json=negativeSpans,proto3" json:"negative_spans"` |
| 1030 | // Use either "negative_deltas" or "negative_counts", the former for |
| 1031 | // regular histograms with integer counts, the latter for float |
| 1032 | // histograms. |
| 1033 | NegativeDeltas []int64 `protobuf:"zigzag64,9,rep,packed,name=negative_deltas,json=negativeDeltas,proto3" json:"negative_deltas,omitempty"` |
| 1034 | NegativeCounts []float64 `protobuf:"fixed64,10,rep,packed,name=negative_counts,json=negativeCounts,proto3" json:"negative_counts,omitempty"` |
| 1035 | // Positive Buckets. |
| 1036 | PositiveSpans []BucketSpan `protobuf:"bytes,11,rep,name=positive_spans,json=positiveSpans,proto3" json:"positive_spans"` |
| 1037 | // Use either "positive_deltas" or "positive_counts", the former for |
| 1038 | // regular histograms with integer counts, the latter for float |
| 1039 | // histograms. |
| 1040 | PositiveDeltas []int64 `protobuf:"zigzag64,12,rep,packed,name=positive_deltas,json=positiveDeltas,proto3" json:"positive_deltas,omitempty"` |
| 1041 | PositiveCounts []float64 `protobuf:"fixed64,13,rep,packed,name=positive_counts,json=positiveCounts,proto3" json:"positive_counts,omitempty"` |
| 1042 | ResetHint Histogram_ResetHint `protobuf:"varint,14,opt,name=reset_hint,json=resetHint,proto3,enum=cortexpb.Histogram_ResetHint" json:"reset_hint,omitempty"` |
| 1043 | // timestamp is in ms format, see model/timestamp/timestamp.go for |
| 1044 | // conversion from time.Time to Prometheus timestamp. |
| 1045 | TimestampMs int64 `protobuf:"varint,15,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` |
| 1046 | // custom_values is an additional field used by non-exponential bucketing layouts. |
| 1047 | // |
| 1048 | // For custom buckets (-53 schema value) custom_values specify monotonically |
| 1049 | // increasing upper inclusive boundaries for the bucket counts with arbitrary |
| 1050 | // widths for this histogram. In other words, custom_values represents custom, |
| 1051 | // explicit bucketing that could have been converted from the classic histograms. |
| 1052 | // |
| 1053 | // Those bounds are then referenced by spans in positive_spans with corresponding positive |
| 1054 | // counts of deltas (refer to positive_spans for more details). This way we can |
| 1055 | // have encode sparse histograms with custom bucketing (many buckets are often |
| 1056 | // not used). |
| 1057 | // |
| 1058 | // Note that for custom bounds, even negative observations are placed in the positive |
| 1059 | // counts to simplify the implementation and avoid ambiguity of where to place |
| 1060 | // an underflow bucket, e.g. (-2, 1]. Therefore negative buckets and |
| 1061 | // the zero bucket are unused, if the schema indicates custom bucketing. |
| 1062 | // |
| 1063 | // For each upper boundary the previous boundary represent the lower exclusive |
| 1064 | // boundary for that bucket. The first element is the upper inclusive boundary |
nothing calls this directly
no outgoing calls
no test coverage detected