victoriametrics

package
v0.3.11-8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ErrVMInvalidResponse = errors.Error("VictoriaMetrics invalid response")
)

Variables

This section is empty.

Functions

func NewVMAdapter

func NewVMAdapter(datasource *tsdb.DataSource) (tsdb.TsdbQueryEndpoint, error)

Types

type Client

type Client interface {
	QueryRange(ctx context.Context, httpCli *http.Client, query string, step time.Duration, timeRange *TimeRange, disableCache bool) (*Response, error)
}

func NewClient

func NewClient(endpoint string) (Client, error)

type Response

type Response struct {
	Status string `json:"status"`
	Data   ResponseData
	Stats  ResponseStats
}

type ResponseData

type ResponseData struct {
	ResultType string               `json:"resultType"`
	Result     []ResponseDataResult `json:"result"`
}

type ResponseDataResult

type ResponseDataResult struct {
	Metric map[string]string         `json:"metric"`
	Values []ResponseDataResultValue `json:"values"`
}

type ResponseDataResultValue

type ResponseDataResultValue []interface{}

ResponseDataResultValue likes: [ 1652169600, "1" ]

type ResponseStats

type ResponseStats struct {
	// SeriesFetched is like integer type: {seriesFetched: "2"}
	SeriesFetched string `json:"seriesFetched"`
}

type TimeRange

type TimeRange struct {
	Start int64
	End   int64
}

func NewTimeRange

func NewTimeRange(start, end int64) *TimeRange

func NewTimeRangeByInfluxTimeRange

func NewTimeRangeByInfluxTimeRange(tr *influxql.TimeRange) *TimeRange

Jump to

Keyboard shortcuts

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