models

package
v0.0.1-test Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlignTimeRange

func AlignTimeRange(t time.Time, step time.Duration, offset int64) time.Time

Types

type Query

type Query struct {
	Expr          string
	Step          time.Duration
	LegendFormat  string
	Start         time.Time
	End           time.Time
	RefId         string
	InstantQuery  bool
	RangeQuery    bool
	ExemplarQuery bool
	UtcOffsetSec  int64
}

func Parse

func Parse(query backend.DataQuery, timeInterval string, intervalCalculator intervalv2.Calculator, fromAlert bool) (*Query, error)

func (*Query) TimeRange

func (query *Query) TimeRange() TimeRange

func (*Query) Type

func (query *Query) Type() TimeSeriesQueryType

type QueryModel

type QueryModel struct {
	Expr           string `json:"expr"`
	LegendFormat   string `json:"legendFormat"`
	Interval       string `json:"interval"`
	IntervalMS     int64  `json:"intervalMS"`
	StepMode       string `json:"stepMode"`
	RangeQuery     bool   `json:"range"`
	InstantQuery   bool   `json:"instant"`
	ExemplarQuery  bool   `json:"exemplar"`
	IntervalFactor int64  `json:"intervalFactor"`
	UtcOffsetSec   int64  `json:"utcOffsetSec"`
}

type ResultType

type ResultType string
const (
	ResultTypeMatrix   ResultType = "matrix"
	ResultTypeExemplar ResultType = "exemplar"
	ResultTypeVector   ResultType = "vector"
	ResultTypeUnknown  ResultType = ""
)

func ResultTypeFromFrame

func ResultTypeFromFrame(frame *data.Frame) ResultType

func (ResultType) String

func (r ResultType) String() string

type TimeRange

type TimeRange struct {
	Start time.Time
	End   time.Time
	Step  time.Duration
}

type TimeSeriesQueryType

type TimeSeriesQueryType string
const (
	RangeQueryType    TimeSeriesQueryType = "range"
	InstantQueryType  TimeSeriesQueryType = "instant"
	ExemplarQueryType TimeSeriesQueryType = "exemplar"
	UnknownQueryType  TimeSeriesQueryType = "unknown"
)

Jump to

Keyboard shortcuts

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