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 ¶
- func Finds(ctx context.Context, backends []Backend, request types.FindRequest) (types.Matches, error)
- func Infos(ctx context.Context, backends []Backend, request types.InfoRequest) ([]types.Info, error)
- func Renders(ctx context.Context, backends []Backend, request types.RenderRequest) ([]types.Metric, error)
- type Backend
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.
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.
Click to show internal directories.
Click to hide internal directories.