influxdb

package
v0.3.9-9 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Apache-2.0 Imports: 17 Imported by: 8

Documentation

Index

Constants

View Source
const (
	BATCH_SEND_SIZE = 10000
)

Variables

This section is empty.

Functions

func BatchSendMetrics

func BatchSendMetrics(urls []string, dbName string, metrics []SMetricData, debug bool) error

func JSONRequest

func JSONRequest(client *http.Client, ctx context.Context, method httputils.THttpMethod, urlStr string, header http.Header,
	body string, debug bool) (http.Header, jsonutils.JSONObject, error)

func SendMetrics

func SendMetrics(urls []string, dbName string, metrics []SMetricData, debug bool) error

Types

type SInfluxdb

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

func NewInfluxdb

func NewInfluxdb(accessUrl string) *SInfluxdb

func NewInfluxdbWithDebug

func NewInfluxdbWithDebug(accessUrl string, debug bool) *SInfluxdb

func (*SInfluxdb) AlterRetentionPolicy

func (db *SInfluxdb) AlterRetentionPolicy(rp SRetentionPolicy) error

func (*SInfluxdb) BatchWrite

func (db *SInfluxdb) BatchWrite(data []string, precision string) error

func (*SInfluxdb) CreateDatabase

func (db *SInfluxdb) CreateDatabase(dbName string) error

func (*SInfluxdb) CreateRetentionPolicy

func (db *SInfluxdb) CreateRetentionPolicy(rp SRetentionPolicy) error

func (*SInfluxdb) GetDatabases

func (db *SInfluxdb) GetDatabases() ([]string, error)

func (*SInfluxdb) GetQuery

func (db *SInfluxdb) GetQuery(sql string) ([][]dbResult, error)

func (*SInfluxdb) GetRetentionPolicies

func (db *SInfluxdb) GetRetentionPolicies() ([]SRetentionPolicy, error)

func (*SInfluxdb) Query

func (db *SInfluxdb) Query(sql string) ([][]dbResult, error)

func (*SInfluxdb) SetDatabase

func (db *SInfluxdb) SetDatabase(dbName string) error

func (*SInfluxdb) SetRetentionPolicy

func (db *SInfluxdb) SetRetentionPolicy(rp SRetentionPolicy) error

func (*SInfluxdb) Write

func (db *SInfluxdb) Write(data string, precision string) error

type SKeyValue

type SKeyValue struct {
	Key   string
	Value string
}

func (SKeyValue) String

func (kv SKeyValue) String() string

type SMetricData

type SMetricData struct {
	Name      string
	Tags      TKeyValuePairs
	Metrics   TKeyValuePairs
	Timestamp time.Time
}

func (*SMetricData) Line

func (m *SMetricData) Line() string

type SRetentionPolicy

type SRetentionPolicy struct {
	Name               string
	Duration           string
	ShardGroupDuration string
	ReplicaN           int
	Default            bool
}

func (*SRetentionPolicy) String

func (rp *SRetentionPolicy) String(dbName string) string

type TKeyValuePairs

type TKeyValuePairs []SKeyValue

func (TKeyValuePairs) Len

func (a TKeyValuePairs) Len() int

func (TKeyValuePairs) Less

func (a TKeyValuePairs) Less(i, j int) bool

func (TKeyValuePairs) Swap

func (a TKeyValuePairs) Swap(i, j int)

Jump to

Keyboard shortcuts

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