storage

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2016 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fanout

type Fanout []SampleAppender

Fanout is a SampleAppender that appends every sample to each SampleAppender in its list.

func (Fanout) Append

func (f Fanout) Append(s *model.Sample) error

Append implements SampleAppender. It appends the provided sample to all SampleAppenders in the Fanout slice and waits for each append to complete before proceeding with the next. If any of the SampleAppenders returns an error, the first one is returned at the end.

func (Fanout) NeedsThrottling

func (f Fanout) NeedsThrottling() bool

NeedsThrottling returns true if at least one of the SampleAppenders in the Fanout slice is throttled.

type SampleAppender

type SampleAppender interface {
	// Append appends a sample to the underlying storage. Depending on the
	// storage implementation, there are different guarantees for the fate
	// of the sample after Append has returned. Remote storage
	// implementation will simply drop samples if they cannot keep up with
	// sending samples. Local storage implementations will only drop metrics
	// upon unrecoverable errors.
	Append(*model.Sample) error
	// NeedsThrottling returns true if the underlying storage wishes to not
	// receive any more samples. Append will still work but might lead to
	// undue resource usage. It is recommended to call NeedsThrottling once
	// before an upcoming batch of Append calls (e.g. a full scrape of a
	// target or the evaluation of a rule group) and only proceed with the
	// batch if NeedsThrottling returns false. In that way, the result of a
	// scrape or of an evaluation of a rule group will always be appended
	// completely or not at all, and the work of scraping or evaluation will
	// not be performed in vain. Also, a call of NeedsThrottling is
	// potentially expensive, so limiting the number of calls is reasonable.
	//
	// Only SampleAppenders for which it is considered critical to receive
	// each and every sample should ever return true. SampleAppenders that
	// tolerate not receiving all samples should always return false and
	// instead drop samples as they see fit to avoid overload.
	NeedsThrottling() bool
}

SampleAppender is the interface to append samples to both, local and remote storage. All methods are goroutine-safe.

Directories

Path Synopsis
Package local contains the local time series storage used by Prometheus.
Package local contains the local time series storage used by Prometheus.
codable
Package codable provides types that implement encoding.BinaryMarshaler and encoding.BinaryUnmarshaler and functions that help to encode and decode primitives.
Package codable provides types that implement encoding.BinaryMarshaler and encoding.BinaryUnmarshaler and functions that help to encode and decode primitives.
index
Package index provides a number of indexes backed by persistent key-value stores.
Package index provides a number of indexes backed by persistent key-value stores.
Package remote is a generated protocol buffer package.
Package remote is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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