promclient

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoRequest

func DoRequest(ctx context.Context, url string, client *http.Client, responseStruct easyjson.Unmarshaler) error

func GetData

func GetData(ctx context.Context, url string, client *http.Client, labelset model.LabelSet) (model.Value, error)

HTTP client for prometheus

func GetSeries

func GetSeries(ctx context.Context, url string, client *http.Client, labelset model.LabelSet) (model.Value, error)

func GetValuesForLabelName

func GetValuesForLabelName(ctx context.Context, url string, client *http.Client) ([]model.LabelValue, error)

func MergeLabelValues added in v0.0.18

func MergeLabelValues(a, b []model.LabelValue) []model.LabelValue

Types

type DataResult

type DataResult struct {
	Status    promhttputil.Status    `json:"status"`
	Data      promhttputil.QueryData `json:"data"`
	ErrorType promhttputil.ErrorType `json:"errorType,omitempty"`
	Error     string                 `json:"error,omitempty"`
}

func (*DataResult) UnmarshalEasyJSON

func (out *DataResult) UnmarshalEasyJSON(in *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*DataResult) UnmarshalJSON

func (v *DataResult) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type LabelResult

type LabelResult struct {
	Status    promhttputil.Status    `json:"status"`
	Data      []model.LabelValue     `json:"data"`
	ErrorType promhttputil.ErrorType `json:"errorType,omitempty"`
	Error     string                 `json:"error,omitempty"`
}

func (LabelResult) MarshalEasyJSON

func (v LabelResult) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (LabelResult) MarshalJSON

func (v LabelResult) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*LabelResult) UnmarshalEasyJSON

func (v *LabelResult) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*LabelResult) UnmarshalJSON

func (v *LabelResult) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SeriesIterator

type SeriesIterator struct {
	V interface{}
	// contains filtered or unexported fields
}

func IteratorsForValue

func IteratorsForValue(v model.Value) []*SeriesIterator

func NewSeriesIterator

func NewSeriesIterator(v interface{}) *SeriesIterator

NewSeriesIterator return a series iterator for the given value TODO: error return if the type is incorrect?

func (*SeriesIterator) At added in v0.0.2

func (s *SeriesIterator) At() (t int64, v float64)

At returns the current timestamp/value pair.

func (*SeriesIterator) Err added in v0.0.2

func (s *SeriesIterator) Err() error

Err returns the current error.

func (*SeriesIterator) Labels added in v0.0.2

func (s *SeriesIterator) Labels() labels.Labels

Returns the metric of the series that the iterator corresponds to.

func (*SeriesIterator) Next added in v0.0.2

func (s *SeriesIterator) Next() bool

Next advances the iterator by one.

func (*SeriesIterator) Seek added in v0.0.2

func (s *SeriesIterator) Seek(t int64) bool

Seek advances the iterator forward to the value at or after the given timestamp.

type SeriesResult

type SeriesResult struct {
	Status    promhttputil.Status    `json:"status"`
	Data      []model.LabelSet       `json:"data"`
	ErrorType promhttputil.ErrorType `json:"errorType,omitempty"`
	Error     string                 `json:"error,omitempty"`
}

func (SeriesResult) MarshalEasyJSON

func (v SeriesResult) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SeriesResult) MarshalJSON

func (v SeriesResult) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SeriesResult) UnmarshalEasyJSON

func (v *SeriesResult) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SeriesResult) UnmarshalJSON

func (v *SeriesResult) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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