client

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyQuery = errors.New("missing query")
View Source
var ErrInvalidFrom = errors.New("invalid from")
View Source
var ErrInvalidQuery = errors.New("invalid query")
View Source
var ErrInvalidUntil = errors.New("invalid until")
View Source
var ErrUnsupportedFormat = errors.New("unsupported format")

Functions

func FormatTypes

func FormatTypes() []string

func MetricsTimestampTruncate

func MetricsTimestampTruncate(metrics []Metric, precision time.Duration)

func TagsNames

func TagsNames(client *http.Client, address string, format FormatType, query string, limit uint64, from, until int64) (string, []string, http.Header, error)

TagsNames do /tags/autoComplete/tags request with query like [tagPrefix];tag1=value1;tag2=~value* Valid formats are json

func TagsValues

func TagsValues(client *http.Client, address string, format FormatType, query string, limit uint64, from, until int64) (string, []string, http.Header, error)

TagsValues do /tags/autoComplete/values request with query like searchTag[=valuePrefix];tag1=value1;tag2=~value* Valid formats are json

Types

type FindMatch

type FindMatch struct {
	Path   string `toml:"path"`
	IsLeaf bool   `toml:"is_leaf"`
}

func MetricsFind

func MetricsFind(client *http.Client, address string, format FormatType, query string, from, until int64) (string, []FindMatch, http.Header, error)

MetricsFind do /metrics/find/ request Valid formats are carbonapi_v3_pb. protobuf, pickle

type FormatType

type FormatType int
const (
	FormatDefault FormatType = iota
	FormatJSON
	FormatProtobuf
	FormatPb_v2 // alias for FormatProtobuf
	FormatPb_v3
	FormatPickle
)

func (*FormatType) Set

func (a *FormatType) Set(value string) error

func (*FormatType) String

func (a *FormatType) String() string

func (*FormatType) UnmarshalText

func (a *FormatType) UnmarshalText(text []byte) error

type HttpError

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

func NewHttpError

func NewHttpError(statusCode int, message string) *HttpError

func (*HttpError) Error

func (e *HttpError) Error() string

type Metric

type Metric struct {
	Name                    string    `toml:"name"`
	PathExpression          string    `toml:"path"`
	ConsolidationFunc       string    `toml:"consolidation"`
	StartTime               int64     `toml:"start"`
	StopTime                int64     `toml:"stop"`
	StepTime                int64     `toml:"step"`
	XFilesFactor            float32   `toml:"xfiles"`
	HighPrecisionTimestamps bool      `toml:"precision"`
	Values                  []float64 `toml:"values"`
	AppliedFunctions        []string  `toml:"applied_functions"`
	RequestStartTime        int64     `toml:"req_start"`
	RequestStopTime         int64     `toml:"req_stop"`
}

func Render

func Render(client *http.Client, address string, format FormatType, targets []string, from, until int64) (string, []Metric, http.Header, error)

Render do /metrics/find/ request Valid formats are carbonapi_v3_pb. protobuf, pickle, json

type MultiGlobRequestV3

type MultiGlobRequestV3 struct {
	protov3.MultiGlobRequest
}

func (*MultiGlobRequestV3) LogInfo

func (r *MultiGlobRequestV3) LogInfo() interface{}

func (*MultiGlobRequestV3) Marshal

func (r *MultiGlobRequestV3) Marshal() ([]byte, error)

Jump to

Keyboard shortcuts

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