prometheus

package
v0.0.0-...-9bd9899 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadTimeSeries

func LoadTimeSeries(device appbackend.Device, from, to time.Time, module, metric string, i int) (appbackend.TimeSeries, error)

Types

type RangeResult

type RangeResult struct {
	Status string `json:"status"`
	Data   struct {
		ResultType string `json:"resultType"`
		Result     []struct {
			Metric struct {
				Name     string `json:"__name__"`
				ID       string `json:"id"`
				Instance string `json:"instance"`
				Job      string `json:"job"`
				Module   string `json:"module"`
			} `json:"metric"`
			Values [][]interface{} `json:"values"`
		} `json:"result"`
	} `json:"data"`
}

RangeResult query result from prometheus

func QueryProm

func QueryProm(query string, start, end int64, n int) (RangeResult, error)

QueryProm fetches metrics from prometheus

func (RangeResult) ToFloat64

func (r RangeResult) ToFloat64(min, max float64) appbackend.TimeSeries

ToFloat64 returns the RangeResult as an array of [timestamp, value]

Jump to

Keyboard shortcuts

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