model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMetricKey

func BuildMetricKey(m *Metric) string

BuildMetricKey builds the key for the given Metric object. So it can be stored in map[string]float64.

Types

type Addr

type Addr struct {
	Ip   string
	Port int
}

func (Addr) String

func (a Addr) String() string

type DetailData

type DetailData struct {
	Timestamp int64
	// 明确是tags
	Tags map[string]string
	// TODO 似乎有一部分case values也是string 此时要和tags区分开
	Values map[string]interface{}
}

func MakeDetailDataSlice

func MakeDetailDataSlice(dd *DetailData, dds ...*DetailData) []*DetailData

func NewDetailData

func NewDetailData() *DetailData

func (*DetailData) WithTag

func (dd *DetailData) WithTag(k string, v string) *DetailData

func (*DetailData) WithTags

func (dd *DetailData) WithTags(tags map[string]string) *DetailData

func (*DetailData) WithValue

func (dd *DetailData) WithValue(k string, v interface{}) *DetailData

func (*DetailData) WithValues

func (dd *DetailData) WithValues(values map[string]interface{}) *DetailData
type Header struct {
	TagKeys   []string `json:"tagKeys"`
	FieldKeys []string `json:"fieldKeys"`
}

type Metric

type Metric struct {
	Name      string            `json:"name"`
	Tags      map[string]string `json:"tags"`
	Timestamp int64             `json:"timestamp"`
	Value     float64           `json:"value"`
}

func (*Metric) String

func (m *Metric) String() string

type Module

type Module interface {
	Start()

	Stop()
}

type Row

type Row struct {
	Timestamp   int64     `json:"timestamp"`
	TagValues   []string  `json:"tagValues"`
	FieldValues []float64 `json:"fieldValues"`
}

type Schema

type Schema struct {
	StringNames []string
	MetricNames []string
}

header

type Table

type Table struct {
	Name   string  `json:"name"`
	Header *Header `json:"header"`
	Rows   []*Row  `json:"rows"`
}

Jump to

Keyboard shortcuts

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