time

package
v11.1.4-modfix Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Copied from https://github.com/grafana/grafana/blob/main/pkg/tsdb/intervalv2/intervalv2.go We're copying this to not block ourselves from decoupling until the conversation here is resolved https://raintank-corp.slack.com/archives/C05QFJUHUQ6/p1700064431005089

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultRes int64 = 1500
)

Functions

func NewCalculator

func NewCalculator(opts ...CalculatorOptions) *intervalCalculator

Types

type Calculator

type Calculator interface {
	Calculate(timerange backend.TimeRange, minInterval time.Duration, maxDataPoints int64) Interval
	CalculateSafeInterval(timerange backend.TimeRange, resolution int64) Interval
}

type CalculatorOptions

type CalculatorOptions struct {
	MinInterval time.Duration
}

type Interval

type Interval struct {
	Text  string
	Value time.Duration
}

Jump to

Keyboard shortcuts

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