utils

package
v0.0.0-...-9649366 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrafanaQueries

type GrafanaQueries struct {
	// QueryGroup is the general category for these queries.
	QueryGroup string
	// Queries is a list of Grafana dashboard compatible queries.
	Queries []GrafanaQuery
	// Index is this query group's index.
	Index int
}

GrafanaQueries is a list of Grafana dashboard compatible queries.

func ParseFileToGrafanaQueries

func ParseFileToGrafanaQueries(
	fileName string,
	log *zap.Logger,
) ([]GrafanaQueries, error)

ParseFileToGrafanaQueries parses a JSON queries file into Grafana dashboard compatible queries.

type GrafanaQuery

type GrafanaQuery struct {
	// Query is the query.
	Query string
	// Interval is the step size.
	Interval string
	// Index is this query's index.
	Index int
	// Left indicates if this panel is on the left.
	Left bool
}

GrafanaQuery is a Grafana dashboard compatible query.

type InputQueries

type InputQueries []InputQuery

InputQueries is a slice of InputQuery.

type InputQuery

type InputQuery struct {
	// QueryGroup is the general category for these queries.
	QueryGroup string `json:"queryGroup"`
	// Queries is the list of raw queries.
	Queries []string `json:"queries"`
	// Steps is the list of step sizes for these queries.
	Steps []string `json:"steps"`
}

InputQuery is the JSON representation of a query to be compared.

type PromQLQueryGroup

type PromQLQueryGroup struct {
	// QueryGroup is the general category for these queries.
	QueryGroup string
	// Queries is a list of PromQL compatible queries.
	Queries []string
}

PromQLQueryGroup is a list of constructed PromQL query groups.

func ParseFileToPromQLQueryGroup

func ParseFileToPromQLQueryGroup(
	fileName string,
	start int64,
	end int64,
	log *zap.Logger,
) ([]PromQLQueryGroup, error)

ParseFileToPromQLQueryGroup parses a JSON queries file into PromQL query groups.

Jump to

Keyboard shortcuts

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