Documentation ¶
Index ¶
- func FormatInterval(inter time.Duration) string
- func GetIntervalFrom(dsInterval, queryInterval string, queryIntervalMS int64, ...) (time.Duration, error)
- func ParseDuration(inp string) (time.Duration, error)
- func ParseInterval(inp string) (time.Duration, error)
- func ParseIntervalStringToTimeDuration(interval string) (time.Duration, error)
- func RoundInterval(interval time.Duration) time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatInterval ¶ added in v0.205.0
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 ¶
ParseDuration parses a duration with support for all units that Grafana uses. Durations are independent of wall time.
func ParseInterval ¶
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
ParseIntervalStringToTimeDuration converts a string representation of a expected (i.e. 1m30s) to time.Duration this method copied from grafana/grafana/pkg/tsdb/intervalv2.go
Types ¶
This section is empty.