gtime

package
v0.228.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 42

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatInterval added in v0.205.0

func FormatInterval(inter time.Duration) string

FormatInterval converts a duration into the units that Grafana uses

func GetIntervalFrom added in v0.207.0

func GetIntervalFrom(dsInterval, queryInterval string, queryIntervalMS int64, defaultInterval time.Duration) (time.Duration, error)

GetIntervalFrom returns the minimum interval. dsInterval is the string representation of data source min interval, if configured. queryInterval is the string representation of query interval (min interval), e.g. "10ms" or "10s". queryIntervalMS is a pre-calculated numeric representation of the query interval in milliseconds.

func ParseDuration

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

ParseDuration parses a duration with support for all units that Grafana uses. Durations are independent of wall time.

func ParseInterval

func ParseInterval(inp string) (time.Duration, error)

ParseInterval parses an interval with support for all units that Grafana uses. An interval is relative to the current wall time.

func ParseIntervalStringToTimeDuration added in v0.207.0

func ParseIntervalStringToTimeDuration(interval string) (time.Duration, error)

ParseIntervalStringToTimeDuration converts a string representation of a expected (i.e. 1m30s) to time.Duration this method copied from grafana/grafana/pkg/tsdb/intervalv2.go

func RoundInterval added in v0.208.0

func RoundInterval(interval time.Duration) time.Duration

RoundInterval returns a predetermined, lower and rounder duration than the given

Types

This section is empty.

Jump to

Keyboard shortcuts

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