mirror of
https://github.com/prometheus/prometheus.git
synced 2025-09-20 21:31:02 +02:00
Apply suggestions from code review
Co-authored-by: Björn Rabenstein <beorn@grafana.com> Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
This commit is contained in:
parent
f0a297bb7c
commit
5e6900558a
@ -39,7 +39,7 @@ var (
|
|||||||
ErrHistogramCustomBucketsInfinite = errors.New("histogram custom bounds must be finite")
|
ErrHistogramCustomBucketsInfinite = errors.New("histogram custom bounds must be finite")
|
||||||
ErrHistogramsIncompatibleSchema = errors.New("cannot apply this operation on histograms with a mix of exponential and custom bucket schemas")
|
ErrHistogramsIncompatibleSchema = errors.New("cannot apply this operation on histograms with a mix of exponential and custom bucket schemas")
|
||||||
ErrHistogramsIncompatibleBounds = errors.New("cannot apply this operation on custom buckets histograms with different custom bounds")
|
ErrHistogramsIncompatibleBounds = errors.New("cannot apply this operation on custom buckets histograms with different custom bounds")
|
||||||
ErrHistogramsInvalidSchema = errors.New("histogram has an invalid schema, which must be between -4 and 8 for exponential buckets, or -53 for custom buckets")
|
ErrHistogramsInvalidSchema = fmt.Errorf("histogram has an invalid schema, which must be between %d and %d for exponential buckets, or %d for custom buckets", ExponentialSchemaMin, ExponentialSchemaMax, CustomBucketsSchema)
|
||||||
)
|
)
|
||||||
|
|
||||||
func IsCustomBucketsSchema(s int32) bool {
|
func IsCustomBucketsSchema(s int32) bool {
|
||||||
|
@ -475,7 +475,7 @@ func validateHistogramSchema(h *prompb.Histogram) error {
|
|||||||
if histogram.IsValidSchema(h.Schema) {
|
if histogram.IsValidSchema(h.Schema) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return fmt.Errorf("invalid histogram schema %d", h.Schema)
|
return return fmt.Errorf("%w, got schema %d", h.Schema, histogram.ErrHistogramsInvalidSchema)
|
||||||
}
|
}
|
||||||
|
|
||||||
func getHistogramValType(h *prompb.Histogram) chunkenc.ValueType {
|
func getHistogramValType(h *prompb.Histogram) chunkenc.ValueType {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user