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]
Click to show internal directories.
Click to hide internal directories.