utils

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 2 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExponentialBucketTimeRange

func ExponentialBucketTimeRange(start, end time.Duration, buckets int) []float64

ExponentialBucketTimeRange creates a bucket set for a histogram that has exponentially increasing intervals between the values, e.g. 0, 0.5, 1, 2, 4, 8, ... Fixed to guarantee exactly 'buckets' number of buckets and produce clean floating-point values.

func LinearBucketRange

func LinearBucketRange(start, end int64, buckets int) []float64

LinearBucketRange creates a bucket set for a histogram that has uniform intervals between the values, e.g. 0, 1, 2, 3, 4, ...

func LinearBucketTimeRange

func LinearBucketTimeRange(start, end time.Duration, buckets int) []float64

LinearBucketTimeRange creates a bucket set for a histogram that has uniform intervals between the values, e.g. 0, 1, 2, 3, 4, ...

Types

This section is empty.

Directories

Path Synopsis
Package assert provides assertions that panic on failure, including checks for errors, values, and view identities.
Package assert provides assertions that panic on failure, including checks for errors, values, and view identities.
Package collections re-exports a subset of the iterators, maps, sets and slices subpackages under shorter names, for callers that only need a handful of these functions and don't want to import each subpackage separately.
Package collections re-exports a subset of the iterators, maps, sets and slices subpackages under shorter names, for callers that only need a handful of these functions and don't want to import each subpackage separately.
iterators
Package iterators provides generic iterators over slices and receive streams, with helpers for mapping, filtering, flattening, batching, and reducing their elements.
Package iterators provides generic iterators over slices and receive streams, with helpers for mapping, filtering, flattening, batching, and reducing their elements.
maps
Package maps provides generic helpers for copying and inverting maps, extracting keys and values, and selecting entries by key or searching by value.
Package maps provides generic helpers for copying and inverting maps, extracting keys and values, and selecting entries by key or searching by value.
sets
Package sets provides mutable sets of unique comparable values, with membership checks, set difference, and conversion to slices.
Package sets provides mutable sets of unique comparable values, with membership checks, set difference, and conversion to slices.
slices
Package slices provides generic helpers for removing elements, computing differences and intersections, and repeating values.
Package slices provides generic helpers for removing elements, computing differences and intersections, and repeating values.
Package deferred holds a value that is supplied after the service owning it has been constructed, and keeps readers from seeing it before it exists.
Package deferred holds a value that is supplied after the service owning it has been constructed, and keeps readers from seeing it before it exists.
Package utils provides helpers for registering constructors and visualizing dependency graphs in dig containers.
Package utils provides helpers for registering constructors and visualizing dependency graphs in dig containers.
Package lazy provides values that are produced only when first requested.
Package lazy provides values that are produced only when first requested.

Jump to

Keyboard shortcuts

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