metric

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// distributed table
	CH_TABLE_ALL = "metrics_all"
	CH_TABLE     = "metrics"
)

Variables

This section is empty.

Functions

func CopyFieldDefine

func CopyFieldDefine(field *pb.FieldDefine) *pb.FieldDefine

CopyTagDefine .

func CopyMeta

func CopyMeta(m *pb.MetricMeta) *pb.MetricMeta

CopyMeta

func CopyNameDefine

func CopyNameDefine(name *pb.NameDefine) *pb.NameDefine

CopyNameDefine .

func CopyTagDefine

func CopyTagDefine(tag *pb.TagDefine) *pb.TagDefine

CopyTagDefine .

func CopyValue

func CopyValue(v *pb.ValueDefine) *pb.ValueDefine

CopyValue .

func FieldsKeys

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

FieldsKeys .

func NewMeta

func NewMeta() *pb.MetricMeta

NewMeta .

func TagsKeys

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

TagsKeys .

Types

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"`
	OrgName   string                 `json:"-"`
}

Metric .

func (*Metric) Copy

func (m *Metric) Copy() *Metric

Copy instance

func (*Metric) GetTags

func (m *Metric) GetTags() map[string]string

func (*Metric) Hash

func (m *Metric) Hash() uint64

func (*Metric) String

func (m *Metric) String() string

type TableMetrics

type TableMetrics struct {
	OrgName           string    `ch:"org_name"`
	TenantId          string    `ch:"tenant_id"`
	MetricGroup       string    `ch:"metric_group"`
	Timestamp         time.Time `ch:"timestamp"`
	NumberFieldKeys   []string  `ch:"number_field_keys"`
	NumberFieldValues []float64 `ch:"number_field_values"`
	StringFieldKeys   []string  `ch:"string_field_keys"`
	StringFieldValues []string  `ch:"string_field_values"`
	TagKeys           []string  `ch:"tag_keys"`
	TagValues         []string  `ch:"tag_values"`
}

type TableMetricsMeta

type TableMetricsMeta struct {
	OrgName         string    `ch:"org_name"`
	TenantId        string    `ch:"tenant_id"`
	MetricGroup     string    `ch:"metric_group"`
	Timestamp       time.Time `ch:"timestamp"`
	NumberFieldKeys []string  `ch:"number_field_keys"`
	StringFieldKeys []string  `ch:"string_field_keys"`
	TagKeys         []string  `ch:"tag_keys"`
}

Jump to

Keyboard shortcuts

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