client

package
v0.0.0-...-ee1864c Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromLabelPairs

func FromLabelPairs(labelPairs []LabelPair) model.Metric

FromLabelPairs unpack a []LabelPair to a model.Metric

func FromMetricsForLabelMatchersRequest

func FromMetricsForLabelMatchersRequest(req *MetricsForLabelMatchersRequest) (model.Time, model.Time, [][]*labels.Matcher, error)

FromMetricsForLabelMatchersRequest unpacks a MetricsForLabelMatchersRequest proto

func FromMetricsForLabelMatchersResponse

func FromMetricsForLabelMatchersResponse(resp *MetricsForLabelMatchersResponse) []model.Metric

FromMetricsForLabelMatchersResponse unpacks a MetricsForLabelMatchersResponse proto

func FromQueryRequest

func FromQueryRequest(req *QueryRequest) (model.Time, model.Time, []*labels.Matcher, error)

FromQueryRequest unpacks a QueryRequest proto.

func FromQueryResponse

func FromQueryResponse(resp *QueryResponse) model.Matrix

FromQueryResponse unpacks a QueryResponse proto.

func FromWriteRequest

func FromWriteRequest(req *WriteRequest) []model.Sample

FromWriteRequest converts a WriteRequest proto into an array of samples.

Types

type Config

type Config struct {
	MaxRecvMsgSize     int
	CompressToIngester bool
	// contains filtered or unexported fields
}

Config is the configuration struct for the ingester client

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags registers configuration settings used by the ingester client config

type Factory

type Factory func(addr string) (grpc_health_v1.HealthClient, error)

Factory defines the signature for an ingester client factory.

type Pool

type Pool struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Pool holds a cache of grpc_health_v1 clients.

func NewPool

func NewPool(cfg PoolConfig, ring ring.ReadRing, factory Factory, logger log.Logger) *Pool

NewPool creates a new Pool.

func (*Pool) Count

func (p *Pool) Count() int

Count returns how many clients are in the cache

func (*Pool) GetClientFor

func (p *Pool) GetClientFor(addr string) (grpc_health_v1.HealthClient, error)

GetClientFor gets the client for the specified address. If it does not exist it will make a new client at that address

func (*Pool) RegisteredAddresses

func (p *Pool) RegisteredAddresses() []string

RegisteredAddresses returns all the addresses that a client is cached for

func (*Pool) RemoveClientFor

func (p *Pool) RemoveClientFor(addr string)

RemoveClientFor removes the client with the specified address

func (*Pool) Stop

func (p *Pool) Stop()

Stop the pool's background cleanup goroutine.

type PoolConfig

type PoolConfig struct {
	ClientCleanupPeriod  time.Duration
	HealthCheckIngesters bool
	RemoteTimeout        time.Duration
}

PoolConfig is config for creating a Pool.

func (*PoolConfig) RegisterFlags

func (cfg *PoolConfig) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to config this to the given FlagSet.

Jump to

Keyboard shortcuts

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