utils

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTime

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

GetTime returns time from the given string.

func ParseDuration

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

ParseDuration parses duration string in Prometheus format

func ParseTime

func ParseTime(s string) (float64, error)

ParseTime parses time s in different formats.

See https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#timestamp-formats

It returns unix timestamp in seconds.

func ParseTimeAt

func ParseTimeAt(s string, currentTimestamp float64) (float64, error)

ParseTimeAt parses time s in different formats, assuming the given currentTimestamp.

See https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#timestamp-formats

It returns unix timestamp in seconds.

func ReplaceTemplateVariable added in v0.5.0

func ReplaceTemplateVariable(expr string, interval int) string

ReplaceTemplateVariable get query and use it expression to remove grafana template variables with

Types

This section is empty.

Jump to

Keyboard shortcuts

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