common

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownsampleMatrix added in v0.0.3

func DownsampleMatrix(matrix promql.Matrix, maxSamples int, avg bool) promql.Matrix

func FormatDate

func FormatDate(value int64) string

func FormatDateRange

func FormatDateRange(start int64, end int64) string

func JoinUrl added in v0.0.3

func JoinUrl(base *url.URL, paths ...string) (*url.URL, error)

func LabelProtosToLabels

func LabelProtosToLabels(labelPairs []prompb.Label) labels.Labels

func MaxInt64 added in v0.0.4

func MaxInt64(x int64, y int64) int64

func MaxUInt8 added in v0.0.4

func MaxUInt8(x uint8, y uint8) uint8

func MinInt64 added in v0.0.4

func MinInt64(x int64, y int64) int64

func MinTime added in v0.0.4

func MinTime(x time.Time, y time.Time) time.Time

func NewCanceller

func NewCanceller() *canceller

func ParseDuration added in v0.0.3

func ParseDuration(s string) (time.Duration, error)

func ParseTime added in v0.0.3

func ParseTime(s string) (time.Time, error)

func TimeMilliseconds added in v0.0.3

func TimeMilliseconds(t model.Time) int64

Types

type Canceller

type Canceller interface {
	C() chan struct{}
	Cancelled() bool
	Cancel()
}

Jump to

Keyboard shortcuts

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