types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package types defines the main Graphite types we use internally.

The definitions correspond to the types of responses to the /render, /info, and /metrics/find handlers in graphite-web and go-carbon.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMetricsNotFound = ErrNotFound("No metrics returned")
	ErrMatchesNotFound = ErrNotFound("No matches found")
	ErrInfoNotFound    = ErrNotFound("No information found")
)

Functions

func MetricsEqual

func MetricsEqual(a, b Metric) bool

func SetCorruptionWatcher

func SetCorruptionWatcher(threshold float64, logger *zap.Logger)

Types

type ErrNotFound

type ErrNotFound string

func (ErrNotFound) Error

func (err ErrNotFound) Error() string

type ErrTimeout

type ErrTimeout struct {
	Err error
}

func (ErrTimeout) Error

func (err ErrTimeout) Error() string

type FindRequest

type FindRequest struct {
	Query string
	Trace
}

func NewFindRequest

func NewFindRequest(query string) FindRequest

type Info

type Info struct {
	Host              string
	Name              string
	AggregationMethod string
	MaxRetention      int32
	XFilesFactor      float32
	Retentions        []Retention
}

Info contains metadata about a metric in Graphite.

func MergeInfos

func MergeInfos(infos [][]Info) []Info

MergeInfos merges Info structures.

type InfoRequest

type InfoRequest struct {
	Target string
	Trace
}

func NewInfoRequest

func NewInfoRequest(target string) InfoRequest

type Match

type Match struct {
	Path   string
	IsLeaf bool
}

type Matches

type Matches struct {
	Name    string
	Matches []Match
}

Matches describes a glob match from a Graphite store.

func MergeMatches

func MergeMatches(matches []Matches) Matches

MergeMatches merges Match structures.

type Metric

type Metric struct {
	Name      string
	StartTime int32
	StopTime  int32
	StepTime  int32
	Values    []float64
	IsAbsent  []bool
}

Metric represents a part of a time series.

func MergeMetrics

func MergeMetrics(metrics [][]Metric) []Metric

MergeMetrics merges metrics by name.

type RenderRequest

type RenderRequest struct {
	Targets []string
	From    int32
	Until   int32
	Trace
}

func NewRenderRequest

func NewRenderRequest(targets []string, from int32, until int32) RenderRequest

type Retention

type Retention struct {
	SecondsPerPoint int32
	NumberOfPoints  int32
}

Retention is the Graphite retention schema for a metric archive.

type Trace

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

func NewTrace

func NewTrace() Trace

func (Trace) AddHTTPCall

func (t Trace) AddHTTPCall(start time.Time)

func (Trace) AddLimiter

func (t Trace) AddLimiter(start time.Time)

func (Trace) AddMarshal

func (t Trace) AddMarshal(start time.Time)

func (Trace) AddReadBody

func (t Trace) AddReadBody(start time.Time)

func (Trace) AddUnmarshal

func (t Trace) AddUnmarshal(start time.Time)

func (Trace) IncCall

func (t Trace) IncCall()

func (Trace) Report

func (t Trace) Report() []int64

Directories

Path Synopsis
encoding
carbonapi_v2
Package carbonapi_v2 defines encoding and decoding methods for Find, Info and Render responses.
Package carbonapi_v2 defines encoding and decoding methods for Find, Info and Render responses.
json
Package json defines encoding and decoding methods for Find, Info and Render responses.
Package json defines encoding and decoding methods for Find, Info and Render responses.
pickle
Package pickle defines encoding methods for Find and Render responses.
Package pickle defines encoding methods for Find and Render responses.

Jump to

Keyboard shortcuts

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