influx

package
v0.0.0-...-4282750 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric interface {
	// Name 指标名称
	Name() string
	// Tags 指标标签(索引字段)
	Tags() map[string]string
	// Fields 指标字段(普通字段)
	Fields() map[string]any
	// Time 指标时间
	Time() time.Time
}

Metric 指标接口

func NewPoint

func NewPoint(name string, tags map[string]string, fields map[string]any, unix time.Time) Metric

type Point

type Point struct {
	MetricName   string            `json:"name"`
	MetricTags   map[string]string `json:"tags"`
	MetricFields map[string]any    `json:"fields"`
	Timestamp    int64             `json:"timestamp"`
	MetricTime   time.Time
}

func ParseLineProtocol

func ParseLineProtocol(lp string) (*Point, error)

ParseLineProtocol 解析InfluxDB的行协议字符串

func (*Point) Fields

func (m *Point) Fields() map[string]any

func (*Point) Name

func (m *Point) Name() string

func (*Point) Tags

func (m *Point) Tags() map[string]string

func (*Point) Time

func (m *Point) Time() time.Time

Jump to

Keyboard shortcuts

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