metric

package
v0.0.0-...-ff51d6a Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GAUGE = "gauge"
	COUNT = "count"
	RATE  = "rate"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricKey

type MetricKey struct {
	Name     string
	TagsHash string
}

type MetricPackage

type MetricPackage struct {
	MetricKey   *MetricKey
	MetricValue *MetricValue
}

type MetricValue

type MetricValue struct {
	Tags   []string
	Points []Point
	Host   string
	Type   string
}

type MetricsMap

type MetricsMap map[MetricKey]MetricValue

func (MetricsMap) Add

func (m MetricsMap) Add(key MetricKey, newVal MetricValue)

type Point

type Point struct {
	Timestamp int64
	Value     float64
}

func (Point) MarshalJSON

func (p Point) MarshalJSON() ([]byte, error)

func (*Point) UnmarshalJSON

func (p *Point) UnmarshalJSON(in []byte) error

type Series

type Series struct {
	Metric string   `json:"metric"`
	Points []Point  `json:"points"`
	Type   string   `json:"type"`
	Host   string   `json:"host,omitempty"`
	Tags   []string `json:"tags,omitempty"`
}

Jump to

Keyboard shortcuts

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