output

package
v0.0.0-...-2987df4 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: MIT Imports: 9 Imported by: 7

Documentation

Index

Constants

View Source
const MaxBatchPoints = 65535

MaxBatchPoints max queue points

View Source
const TimeWriteRetry = 10

TimeWriteRetry time wait

Variables

View Source
var DummyDB = &InfluxDB{
	cfg:         nil,
	initialized: false,
	started:     false,
	dummy:       true,
	iChan:       nil,
	chExit:      nil,
	client:      nil,
}

DummyDB a BD struct needed if no database configured

Functions

func Ping

func Ping(cfg *config.InfluxCfg) (client.Client, time.Duration, string, error)

Ping InfluxDB Server

func SetLogger

func SetLogger(l *logrus.Logger)

SetLogger adds a logger to this module

Types

type InfluxDB

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

InfluxDB database export

func NewNotInitInfluxDB

func NewNotInitInfluxDB(c *config.InfluxCfg) *InfluxDB

NewNotInitInfluxDB Create Object in memory but not initialized until ready connection needed

func (*InfluxDB) BP

func (db *InfluxDB) BP() (*client.BatchPoints, error)

BP create a Batch point influx object

func (*InfluxDB) CheckAndSetInitialized

func (db *InfluxDB) CheckAndSetInitialized() bool

CheckAndSetInitialized check if this thread is already working and set if not

func (*InfluxDB) CheckAndSetStarted

func (db *InfluxDB) CheckAndSetStarted() bool

CheckAndSetStarted check if this thread is already working and set if not

func (*InfluxDB) CheckAndUnSetInitialized

func (db *InfluxDB) CheckAndUnSetInitialized() bool

CheckAndUnSetInitialized check if this thread is already working and set if not

func (*InfluxDB) CheckAndUnSetStarted

func (db *InfluxDB) CheckAndUnSetStarted() bool

CheckAndUnSetStarted check if this thread is already working and unset if not

func (*InfluxDB) Connect

func (db *InfluxDB) Connect() error

Connect to influxdb

func (*InfluxDB) End

func (db *InfluxDB) End()

End release DB connection

func (*InfluxDB) GetResetStats

func (db *InfluxDB) GetResetStats() *InfluxStats

GetResetStats return outdb stats and reset its counters

func (*InfluxDB) Hostname

func (db *InfluxDB) Hostname() string

Hostname get hostname

func (*InfluxDB) Init

func (db *InfluxDB) Init()

Init initialies runtime info

func (*InfluxDB) IsStarted

func (db *InfluxDB) IsStarted() bool

IsStarted check if this thread is already working

func (*InfluxDB) Send

func (db *InfluxDB) Send(bps *client.BatchPoints)

Send send data

func (*InfluxDB) SetStartedAs

func (db *InfluxDB) SetStartedAs(st bool)

SetStartedAs change started state

func (*InfluxDB) StartSender

func (db *InfluxDB) StartSender(wg *sync.WaitGroup)

StartSender begins sender loop

func (*InfluxDB) StopSender

func (db *InfluxDB) StopSender()

StopSender finalize sender goroutines

type InfluxStats

type InfluxStats struct {
	// Fields Sent
	FieldSent int64
	// Field Sent the max
	FieldSentMax int64
	// Points Sent
	PSent int64
	// PSentMax the max
	PSentMax int64
	// WriteSent BatchPoints sent
	WriteSent int64
	// WriteErrors BatchPoints with  errors
	WriteErrors int64
	// WriteTime
	WriteTime time.Duration
	// WriteTimeMax
	WriteTimeMax time.Duration
	// contains filtered or unexported fields
}

InfluxStats get stats

func (*InfluxStats) GetResetStats

func (is *InfluxStats) GetResetStats() *InfluxStats

GetResetStats get stats for this InfluxStats Output

func (*InfluxStats) WriteErrUpdate

func (is *InfluxStats) WriteErrUpdate(wt time.Duration)

WriteErrUpdate update stats on write error

func (*InfluxStats) WriteOkUpdate

func (is *InfluxStats) WriteOkUpdate(ps int64, fs int64, wt time.Duration)

WriteOkUpdate update stats on write ok

Jump to

Keyboard shortcuts

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