backend

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: 7 Imported by: 0

Documentation

Overview

Package backend defines an interface and RPC methods for communication with Graphite backends.

Example use:

var b Backend
metrics, err := Render(ctx, b, from, until, targets)

The package will transparently handle concurrent requests to multiple backends:

var bs []Backend
metrics, err := Renders(ctx, bs, from, until, targets)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Finds

func Finds(ctx context.Context, backends []Backend, request types.FindRequest) (types.Matches, error)

Finds makes Find calls to multiple backends.

func Infos

func Infos(ctx context.Context, backends []Backend, request types.InfoRequest) ([]types.Info, error)

Infos makes Info calls to multiple backends.

func Renders

func Renders(ctx context.Context, backends []Backend, request types.RenderRequest) ([]types.Metric, error)

Renders makes Render calls to multiple backends.

Types

type Backend

type Backend interface {
	Find(context.Context, types.FindRequest) (types.Matches, error)
	Info(context.Context, types.InfoRequest) ([]types.Info, error)
	Render(context.Context, types.RenderRequest) ([]types.Metric, error)

	Contains([]string) bool // Reports whether a backend contains any of the given targets.
	Logger() *zap.Logger    // A logger used to communicate non-fatal warnings.
	Probe()                 // Probe updates internal state of the backend.
}

Backend codifies the RPC calls a Graphite backend responds to.

func Filter

func Filter(backends []Backend, targets []string) []Backend

Filter filters the given backends by whether they Contain() the given targets.

Directories

Path Synopsis
Package mock defines a mock backend for testing.
Package mock defines a mock backend for testing.
Package net implements a backend that communicates over a network.
Package net implements a backend that communicates over a network.

Jump to

Keyboard shortcuts

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