influxdb

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enable     bool   `yaml:"enable"`
	Address    string `yaml:"address"`
	Port       int    `yaml:"port"`
	UDPAddress string `yaml:"udp_address"`
	Database   string `yaml:"database"`
	// precision: n, u, ms, s, m or h
	Precision           string `yaml:"precision"`
	UserName            string `yaml:"username"`
	Password            string `yaml:"password"`
	MaxIdleConns        int    `yaml:"max-idle-conns"`
	MaxIdleConnsPerHost int    `yaml:"max-idle-conns-per-host"`
	IdleConnTimeout     int    `yaml:"idle-conn-timeout"`
}

type CustomConfig

type CustomConfig struct {
	Enabled    bool   `yaml:"enabled"`
	Address    string `yaml:"address"`
	Port       int    `yaml:"port"`
	UDPAddress string `yaml:"udp_address"`
	Database   string `yaml:"database"`
	// precision: n, u, ms, s, m or h
	Precision           string `yaml:"precision"`
	UserName            string `yaml:"username"`
	Password            string `yaml:"password"`
	ReadUserName        string `yaml:"read-username"`
	ReadPassword        string `yaml:"read-password"`
	MaxIdleConns        int    `yaml:"max-idle-conns"`
	MaxIdleConnsPerHost int    `yaml:"max-idle-conns-per-host"`
	IdleConnTimeout     int    `yaml:"idle-conn-timeout"`
	FlushSize           int    `yaml:"flush-size"`
	FlushTime           int    `yaml:"flush-time"`
}

CustomConfig Custom Configuration

type HTTPClient

type HTTPClient struct {
	Client            client.Client
	BatchPointsConfig client.BatchPointsConfig
}

HTTPClient HTTP Client

func (*HTTPClient) FluxDBHttpClose

func (p *HTTPClient) FluxDBHttpClose() (err error)

FluxDBHttpClose ...

func (*HTTPClient) FluxDBHttpWrite

func (p *HTTPClient) FluxDBHttpWrite(bp client.BatchPoints) (err error)

FluxDBHttpWrite ...

type Metrics

type Metrics struct {
	InfluxDBHttpClient *HTTPClient
	// contains filtered or unexported fields
}

Metrics ...

func NewMetrics

func NewMetrics(influxDBHttpClient *HTTPClient, conf *CustomConfig) (*Metrics, error)

NewMetrics ...

func (*Metrics) AddPoint

func (mt *Metrics) AddPoint(metricsData *MetricsData) error

func (*Metrics) Write

func (mt *Metrics) Write() error

type MetricsData

type MetricsData struct {
	Measurement string                 `json:"measurement"`
	Fields      map[string]interface{} `json:"fields"`
	Tags        map[string]string      `json:"tags"`
}

MetricsData ...

type Response

type Response struct {
	State int      `json:"state"`
	Data  struct{} `json:"data"`
	Msg   string   `json:"msg"`
}

Response ...

Directories

Path Synopsis
Package client implements a now-deprecated client for InfluxDB; use github.com/ztalab/zta-tools/influxdb/client/v2 instead.
Package client implements a now-deprecated client for InfluxDB; use github.com/ztalab/zta-tools/influxdb/client/v2 instead.
models
Package models implements basic objects used throughout the TICK stack.
Package models implements basic objects used throughout the TICK stack.
pkg/escape
Package escape contains utilities for escaping parts of InfluxQL and InfluxDB line protocol.
Package escape contains utilities for escaping parts of InfluxQL and InfluxDB line protocol.
v2
Package client (v2) is the current official Go client for InfluxDB.
Package client (v2) is the current official Go client for InfluxDB.

Jump to

Keyboard shortcuts

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