promhttputil

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2018 License: MIT Imports: 7 Imported by: 0

README

Rename to promutil?

This is a collection of a bunch of prometheus util methods etc.

Documentation

Index

Constants

View Source
const (
	ErrorNone     ErrorType = ""
	ErrorTimeout            = "timeout"
	ErrorCanceled           = "canceled"
	ErrorExec               = "execution"
	ErrorBadData            = "bad_data"
	ErrorInternal           = "internal"
)

Variables

This section is empty.

Functions

func MergeSampleStream

func MergeSampleStream(antiAffinityBuffer model.Time, a, b *model.SampleStream) (*model.SampleStream, error)

func MergeValues

func MergeValues(antiAffinityBuffer model.Time, a, b model.Value) (model.Value, error)

TODO: always make copies? Now we sometimes return one, or make a copy, or do nothing Merge 2 values and

func ParseDuration

func ParseDuration(s string) (time.Duration, error)

func ParseTime

func ParseTime(s string) (model.Time, error)

func ValueAddLabelSet

func ValueAddLabelSet(a model.Value, l model.LabelSet) error

Types

type ErrorType

type ErrorType string

type QueryData

type QueryData struct {
	ResultType model.ValueType `json:"resultType"`
	Result     model.Value     `json:"result"`
}

func (*QueryData) UnmarshalEasyJSON

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*QueryData) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type Status

type Status string

TODO: have the api.go thing export these

const (
	StatusSuccess Status = "success"
	StatusError          = "error"
)

Jump to

Keyboard shortcuts

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