histogram

package
v1.11.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package histogram provides a Prometheus histogram model for the API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BucketsAsJSON added in v1.11.4

func BucketsAsJSON[BC model.BucketCount](buckets []APIBucket[BC]) [][]any

BucketsAsJSON takes a slice of APIBucket models and returns it as json.

func BucketsAsJson deprecated

func BucketsAsJson[BC model.BucketCount](buckets []APIBucket[BC]) [][]any

BucketsAsJson takes a slice of APIBucket models and returns it as json.

Deprecated: Use BucketsAsJSON.

func NewModelHistogram

func NewModelHistogram(ch *dto.Histogram) (*model.Histogram, *model.FloatHistogram)

NewModelHistogram creates a Prometheus histogram model.

Types

type APIBucket

type APIBucket[BC model.BucketCount] struct {
	Boundaries   uint64
	Lower, Upper float64
	Count        BC
}

APIBucket defines Prometheus histogram buckets.

func GetAPIBuckets

func GetAPIBuckets(h *model.Histogram) []APIBucket[uint64]

GetAPIBuckets returns a slice of APIBucket based on a histogram.

func GetAPIFloatBuckets

func GetAPIFloatBuckets(h *model.FloatHistogram) []APIBucket[float64]

GetAPIFloatBuckets takes a float histogram and returns a slie of APIBucket.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL