influxClient

package
v2.8.4 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToInfluxPoint

func ToInfluxPoint(point Point) *influxdb2Write.Point

Types

type AuxiliaryTag

type AuxiliaryTag interface {
	Tag() string
	MatchString(value string) bool
	TagValues() map[string]string
}

type Client

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

func RunClient

func RunClient(config Config, auxiliaryTags []AuxiliaryTag, localDb LocalDb, statistics Statistics) *Client

func (Client) Name

func (ic Client) Name() string

func (Client) Shutdown

func (ic Client) Shutdown()

func (Client) WritePoint

func (ic Client) WritePoint(point Point)

type ClientPool

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

func RunPool

func RunPool() (pool *ClientPool)

func (*ClientPool) AddClient

func (p *ClientPool) AddClient(client *Client)

func (*ClientPool) GetReceiverClientsNames

func (p *ClientPool) GetReceiverClientsNames(receiverNames []string) (ret []string)

func (*ClientPool) RemoveClient

func (p *ClientPool) RemoveClient(client *Client)

func (*ClientPool) Shutdown

func (p *ClientPool) Shutdown()

func (*ClientPool) WritePoint

func (p *ClientPool) WritePoint(point Point, receiverNames []string)

type Config

type Config interface {
	Name() string
	Url() string
	Token() string
	Org() string
	Bucket() string
	WriteInterval() time.Duration
	RetryInterval() time.Duration
	AggregateInterval() time.Duration
	TimePrecision() time.Duration
	ConnectTimeout() time.Duration
	BatchSize() uint
	RetryQueueLimit() uint
	LogDebug() bool
}

type LocalDb

type LocalDb interface {
	Enabled() bool
	InfluxBacklogAdd(client, batch string) error
	InfluxBacklogSize(client string) (numbBatches, numbLines uint, err error)
	InfluxBacklogGet(client string) (id int, batch string, err error)
	InfluxBacklogDelete(id int) error
	InfluxAggregateBacklog(client string, batchSize uint) error
}

type Point

type Point interface {
	Measurement() string
	Tags() map[string]string
	Fields() map[string]interface{}
	Time() time.Time
}

type Statistics

type Statistics interface {
	IncrementOne(module, name, field string)
}

Jump to

Keyboard shortcuts

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