Documentation ¶
Index ¶
- Constants
- Variables
- func Ping(cfg *config.InfluxCfg) (client.Client, time.Duration, string, error)
- func SetLogger(l *logrus.Logger)
- type InfluxDB
- func (db *InfluxDB) BP() (*client.BatchPoints, error)
- func (db *InfluxDB) CheckAndSetInitialized() bool
- func (db *InfluxDB) CheckAndSetStarted() bool
- func (db *InfluxDB) CheckAndUnSetInitialized() bool
- func (db *InfluxDB) CheckAndUnSetStarted() bool
- func (db *InfluxDB) Connect() error
- func (db *InfluxDB) End()
- func (db *InfluxDB) GetResetStats() *InfluxStats
- func (db *InfluxDB) Hostname() string
- func (db *InfluxDB) Init()
- func (db *InfluxDB) IsStarted() bool
- func (db *InfluxDB) Send(bps *client.BatchPoints)
- func (db *InfluxDB) SetStartedAs(st bool)
- func (db *InfluxDB) StartSender(wg *sync.WaitGroup)
- func (db *InfluxDB) StopSender()
- type InfluxStats
Constants ¶
const MaxBatchPoints = 65535
MaxBatchPoints max queue points
const TimeWriteRetry = 10
TimeWriteRetry time wait
Variables ¶
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 ¶
Types ¶
type InfluxDB ¶
type InfluxDB struct {
// contains filtered or unexported fields
}
InfluxDB database export
func NewNotInitInfluxDB ¶
NewNotInitInfluxDB Create Object in memory but not initialized until ready connection needed
func (*InfluxDB) CheckAndSetInitialized ¶
CheckAndSetInitialized check if this thread is already working and set if not
func (*InfluxDB) CheckAndSetStarted ¶
CheckAndSetStarted check if this thread is already working and set if not
func (*InfluxDB) CheckAndUnSetInitialized ¶
CheckAndUnSetInitialized check if this thread is already working and set if not
func (*InfluxDB) CheckAndUnSetStarted ¶
CheckAndUnSetStarted check if this thread is already working and unset if not
func (*InfluxDB) GetResetStats ¶
func (db *InfluxDB) GetResetStats() *InfluxStats
GetResetStats return outdb stats and reset its counters
func (*InfluxDB) SetStartedAs ¶
SetStartedAs change started state
func (*InfluxDB) StartSender ¶
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