influxdb

package
v4.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InfluxClient

type InfluxClient struct {
	Client    client.Client
	Database  string
	Precision string
}

func NewInfluxdbClient

func NewInfluxdbClient(section InfluxdbSection) (*InfluxClient, error)

func (*InfluxClient) Send

func (c *InfluxClient) Send(items []*dataobj.InfluxdbItem) error

type InfluxdbDataSource

type InfluxdbDataSource struct {
	// config
	Section               InfluxdbSection
	SendQueueMaxSize      int
	SendTaskSleepInterval time.Duration

	// 发送缓存队列 node -> queue_of_data
	InfluxdbQueue *list.SafeListLimited
}

func (*InfluxdbDataSource) GetInstance

func (influxdb *InfluxdbDataSource) GetInstance(metric, endpoint string, tags map[string]string) []string

func (*InfluxdbDataSource) Init

func (influxdb *InfluxdbDataSource) Init()

func (*InfluxdbDataSource) Push2Queue

func (influxdb *InfluxdbDataSource) Push2Queue(items []*dataobj.MetricValue)

将原始数据插入到influxdb缓存队列

func (*InfluxdbDataSource) QueryData

func (influxdb *InfluxdbDataSource) QueryData(inputs []dataobj.QueryData) []*dataobj.TsdbQueryResponse

select value from metric where ...

func (*InfluxdbDataSource) QueryDataForUI

func (influxdb *InfluxdbDataSource) QueryDataForUI(input dataobj.QueryDataForUI) []*dataobj.TsdbQueryResponse

todo : 支持 comparison select value from metric where ...

func (*InfluxdbDataSource) QueryIndexByClude

func (influxdb *InfluxdbDataSource) QueryIndexByClude(recvs []dataobj.CludeRecv) []dataobj.XcludeResp

show series from metric where ...

func (*InfluxdbDataSource) QueryIndexByFullTags

func (influxdb *InfluxdbDataSource) QueryIndexByFullTags(recvs []dataobj.IndexByFullTagsRecv) ([]dataobj.IndexByFullTagsResp, int)

show series from metric where ...

func (*InfluxdbDataSource) QueryMetrics

func (influxdb *InfluxdbDataSource) QueryMetrics(recv dataobj.EndpointsRecv) *dataobj.MetricResp

show measurements on n9e

func (*InfluxdbDataSource) QueryTagPairs

func (influxdb *InfluxdbDataSource) QueryTagPairs(recv dataobj.EndpointMetricRecv) []dataobj.IndexTagkvResp

show tag keys / values from metric ...

type InfluxdbSection

type InfluxdbSection struct {
	Enabled   bool   `yaml:"enabled"`
	Name      string `yaml:"name"`
	Batch     int    `yaml:"batch"`
	MaxRetry  int    `yaml:"maxRetry"`
	WorkerNum int    `yaml:"workerNum"`
	Timeout   int    `yaml:"timeout"`
	Address   string `yaml:"address"`
	Database  string `yaml:"database"`
	Username  string `yaml:"username"`
	Password  string `yaml:"password"`
	Precision string `yaml:"precision"`
}

type QueryData

type QueryData struct {
	Start     int64
	End       int64
	Metric    string
	Endpoints []string
	Tags      []string
	Step      int
	DsType    string
	GroupKey  []string //聚合维度
	AggrFunc  string   //聚合计算

	RawQuery string
}

type ShowSeries

type ShowSeries struct {
	Database  string
	Metric    string
	Endpoints []string
	Include   []*dataobj.TagPair
	Exclude   []*dataobj.TagPair
	Start     int64
	End       int64

	RawQuery string
}

Jump to

Keyboard shortcuts

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