storage

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BATCH_FLUSH_INTERVAL = 500 * time.Millisecond

	MAX_BATCH_SIZE_IN_BYTES             = 32 * 1024
	MAX_INTERNODE_PAYLOAD_SIZE_IN_BYTES = 2 * MAX_BATCH_SIZE_IN_BYTES
)

Variables

This section is empty.

Functions

func NewExponentialTicker

func NewExponentialTicker(cfg TickerConfig) (chan struct{}, func())

func NewRemoteAppender

func NewRemoteAppender(targetNodeIndex string, connection *leanstreams.Connection, done chan struct{}, opts ...RemoteAppenderOption) prom_storage.Appender

func NewRemoteQuerier

func NewRemoteQuerier(
	ctx context.Context,
	index int,
	addr string,
	egressTLSConfig *config_util.TLSConfig,
	logger *logger.Logger,
) (prom_storage.Querier, error)

func NewReplicatedAppender

func NewReplicatedAppender(appenders []storage.Appender, lookup routing.Lookup, opts ...ReplicatedAppenderOption) prom_storage.Appender

func NewReplicatedStorage

func NewReplicatedStorage(
	localStore prom_storage.Storage,
	localIndex int,
	nodeAddrs []string,
	internodeAddrs []string,
	replicationFactor uint,
	internodeTLSConfig *tls.Config,
	egressTLSConfig *config_util.TLSConfig,
	queryTimeout time.Duration,
	opts ...ReplicatedOption,
) prom_storage.Storage

func NewScrapeStorage

func NewScrapeStorage(store prom_storage.Storage) scrape.Appendable

Types

type QuerierFactory

type QuerierFactory interface {
	Build(ctx context.Context, nodeIndexes ...int) []prom_storage.Querier
}

type RemoteAppender

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

func (*RemoteAppender) Add

func (a *RemoteAppender) Add(l labels.Labels, timestamp int64, value float64) (uint64, error)

func (*RemoteAppender) AddFast

func (a *RemoteAppender) AddFast(l labels.Labels, ref uint64, t int64, v float64) error

func (*RemoteAppender) Commit

func (a *RemoteAppender) Commit() error

func (*RemoteAppender) Rollback

func (a *RemoteAppender) Rollback() error

type RemoteAppenderOption

type RemoteAppenderOption func(*RemoteAppender)

func WithRemoteAppenderHandoffStoragePath

func WithRemoteAppenderHandoffStoragePath(handoffStoragePath string) RemoteAppenderOption

func WithRemoteAppenderLogger

func WithRemoteAppenderLogger(log *logger.Logger) RemoteAppenderOption

func WithRemoteAppenderMetrics

func WithRemoteAppenderMetrics(metrics debug.MetricRegistrar) RemoteAppenderOption

type RemoteQuerier

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

func (*RemoteQuerier) Close

func (r *RemoteQuerier) Close() error

func (*RemoteQuerier) LabelNames

func (r *RemoteQuerier) LabelNames() ([]string, prom_storage.Warnings, error)

func (*RemoteQuerier) LabelValues

func (r *RemoteQuerier) LabelValues(name string) ([]string, prom_storage.Warnings, error)

func (*RemoteQuerier) Select

type ReplicatedAppender

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

func (*ReplicatedAppender) Add

func (a *ReplicatedAppender) Add(l labels.Labels, time int64, value float64) (uint64, error)

func (*ReplicatedAppender) AddFast

func (a *ReplicatedAppender) AddFast(l labels.Labels, ref uint64, time int64, value float64) error

func (*ReplicatedAppender) Commit

func (a *ReplicatedAppender) Commit() error

func (*ReplicatedAppender) Rollback

func (s *ReplicatedAppender) Rollback() error

type ReplicatedAppenderOption

type ReplicatedAppenderOption func(*ReplicatedAppender)

func WithReplicatedAppenderLogger

func WithReplicatedAppenderLogger(log *logger.Logger) ReplicatedAppenderOption

func WithReplicatedAppenderMetrics

func WithReplicatedAppenderMetrics(metrics debug.MetricRegistrar) ReplicatedAppenderOption

type ReplicatedOption

type ReplicatedOption func(*ReplicatedStorage)

func WithReplicatedHandoffStoragePath

func WithReplicatedHandoffStoragePath(handoffStoragePath string) ReplicatedOption

func WithReplicatedLogger

func WithReplicatedLogger(log *logger.Logger) ReplicatedOption

func WithReplicatedMetrics

func WithReplicatedMetrics(metrics debug.MetricRegistrar) ReplicatedOption

type ReplicatedQuerier

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

func NewReplicatedQuerier

func NewReplicatedQuerier(ctx context.Context, localStore prom_storage.Storage, localIndex int, factory QuerierFactory,
	queryTimeout time.Duration, routingTable Routing, log *logger.Logger) *ReplicatedQuerier

func (*ReplicatedQuerier) Close

func (r *ReplicatedQuerier) Close() error

func (*ReplicatedQuerier) LabelNames

func (r *ReplicatedQuerier) LabelNames() ([]string, prom_storage.Warnings, error)

func (*ReplicatedQuerier) LabelValues

func (r *ReplicatedQuerier) LabelValues(name string) ([]string, prom_storage.Warnings, error)

func (*ReplicatedQuerier) Select

type ReplicatedQuerierFactory

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

func NewReplicatedQuerierFactory

func NewReplicatedQuerierFactory(localStore prom_storage.Storage,
	localIndex int, nodeAddrs []string, egressTLSConfig *config_util.TLSConfig,
	log *logger.Logger) *ReplicatedQuerierFactory

func (*ReplicatedQuerierFactory) Build

func (factory *ReplicatedQuerierFactory) Build(ctx context.Context, nodeIndexes ...int) []prom_storage.Querier

type ReplicatedStorage

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

func (*ReplicatedStorage) Appender

func (r *ReplicatedStorage) Appender() (storage.Appender, error)

func (*ReplicatedStorage) Close

func (r *ReplicatedStorage) Close() error

func (*ReplicatedStorage) Querier

func (r *ReplicatedStorage) Querier(ctx context.Context, _, _ int64) (storage.Querier, error)

func (*ReplicatedStorage) StartTime

func (r *ReplicatedStorage) StartTime() (int64, error)

type Routing

type Routing interface {
	Lookup(item string) []int
	IsLocal(metricName string) bool
}

type ScrapeAppender

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

func (*ScrapeAppender) Add

func (s *ScrapeAppender) Add(l labels.Labels, t int64, v float64) (uint64, error)

func (*ScrapeAppender) AddFast

func (s *ScrapeAppender) AddFast(l labels.Labels, ref uint64, t int64, v float64) error

func (*ScrapeAppender) Commit

func (s *ScrapeAppender) Commit() error

func (*ScrapeAppender) Rollback

func (s *ScrapeAppender) Rollback() error

type ScrapeStorage

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

func (*ScrapeStorage) Appender

func (s *ScrapeStorage) Appender() (prom_storage.Appender, error)

type TickerConfig

type TickerConfig struct {
	BaseDelay  time.Duration
	Multiplier float64
	MaxDelay   time.Duration
	Context    context.Context
}

Jump to

Keyboard shortcuts

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