metrics

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldDefine

type FieldDefine struct {
	Key    string         `json:"key"`
	Type   string         `json:"type"`
	Name   string         `json:"name"`
	Unit   string         `json:"uint"`
	Values []*ValueDefine `json:"values,omitempty"`
}

FieldDefine .

type Metric

type Metric struct {
	Name      string                 `json:"name"`
	Timestamp int64                  `json:"timestamp"`
	Tags      map[string]string      `json:"tags"`
	Fields    map[string]interface{} `json:"fields"`
}

Metric .

func New

func New() *Metric

New .

func (*Metric) Copy

func (m *Metric) Copy() *Metric

Copy instance

func (*Metric) String

func (m *Metric) String() string

type MetricMeta

type MetricMeta struct {
	Name   NameDefine              `json:"name"`
	Labels map[string]string       `json:"labels,omitempty"`
	Tags   map[string]*TagDefine   `json:"tags"`
	Fields map[string]*FieldDefine `json:"fields"`
}

MetricMeta .

func NewMeta

func NewMeta() *MetricMeta

NewMeta .

func (*MetricMeta) FieldsKeys

func (m *MetricMeta) FieldsKeys() []string

FieldsKeys .

func (*MetricMeta) TagsKeys

func (m *MetricMeta) TagsKeys() []string

TagsKeys .

type NameDefine

type NameDefine struct {
	Key  string `json:"key" `
	Name string `json:"name"`
}

NameDefine .

type TagDefine

type TagDefine struct {
	Key    string         `json:"key"`
	Name   string         `json:"name"`
	Values []*ValueDefine `json:"values,omitempty"`
}

TagDefine .

type ValueDefine

type ValueDefine struct {
	Value interface{} `json:"value"`
	Name  string      `json:"name"`
}

ValueDefine .

Jump to

Keyboard shortcuts

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