mqe

package
v4.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxWorker int = 4
)

Functions

func NewApiClient

func NewApiClient(httpClient *http.Client, datasource *models.DataSource) *apiClient

func NewMQEExecutor

func NewMQEExecutor(dsInfo *models.DataSource) (tsdb.Executor, error)

Types

type Function

type Function struct {
	Func string
}

type MQEExecutor

type MQEExecutor struct {
	*models.DataSource
	// contains filtered or unexported fields
}

func (*MQEExecutor) Execute

func (e *MQEExecutor) Execute(ctx context.Context, queries tsdb.QuerySlice, queryContext *tsdb.QueryContext) *tsdb.BatchResult

type MQEResponse

type MQEResponse struct {
	Success bool               `json:"success"`
	Name    string             `json:"name"`
	Body    []MQEResponseSerie `json:"body"`
}

type MQEResponseSerie

type MQEResponseSerie struct {
	Query     string            `json:"query"`
	Name      string            `json:"name"`
	Type      string            `json:"type"`
	Series    []MQESerie        `json:"series"`
	TimeRange ResponseTimeRange `json:"timerange"`
}

type MQESerie

type MQESerie struct {
	Values []null.Float      `json:"values"`
	Tagset map[string]string `json:"tagset"`
}

type Metric

type Metric struct {
	Metric string
	Alias  string
}

type Query

type Query struct {
	Metrics           []Metric
	Hosts             []string
	Cluster           []string
	FunctionList      []Function
	AddClusterToAlias bool
	AddHostToAlias    bool

	TimeRange   *tsdb.TimeRange
	UseRawQuery bool
	RawQuery    string
}

func (*Query) Build

func (q *Query) Build(availableSeries []string) ([]QueryToSend, error)

type QueryParser

type QueryParser struct{}

func NewQueryParser

func NewQueryParser() *QueryParser

func (*QueryParser) Parse

func (qp *QueryParser) Parse(model *simplejson.Json, dsInfo *models.DataSource, queryContext *tsdb.QueryContext) (*Query, error)

type QueryToSend

type QueryToSend struct {
	RawQuery string
	Metric   Metric
	QueryRef *Query
}

type ResponseParser

type ResponseParser struct {
	// contains filtered or unexported fields
}

func NewResponseParser

func NewResponseParser() *ResponseParser

func (*ResponseParser) Parse

func (parser *ResponseParser) Parse(res *http.Response, queryRef QueryToSend) ([]*tsdb.TimeSeries, error)

type ResponseTimeRange

type ResponseTimeRange struct {
	Start      int64 `json:"start"`
	End        int64 `json:"end"`
	Resolution int64 `json:"Resolution"`
}

type TokenBody

type TokenBody struct {
	Metrics []string
}

type TokenClient

type TokenClient struct {
	Datasource *models.DataSource
	HttpClient *http.Client
	// contains filtered or unexported fields
}

func NewTokenClient

func NewTokenClient(datasource *models.DataSource) *TokenClient

func (*TokenClient) GetTokenData

func (client *TokenClient) GetTokenData(ctx context.Context) (*TokenBody, error)

func (*TokenClient) RequestTokenData

func (client *TokenClient) RequestTokenData(ctx context.Context) (*TokenBody, error)

type TokenResponse

type TokenResponse struct {
	Success bool
	Body    TokenBody
}

Jump to

Keyboard shortcuts

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