metric03

package
v1.11.0 Latest Latest
Warning

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

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

Documentation

Overview

Package metric03 holds the structure for the old mskpack cmetrics version 0.3.x.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateMetrics

type CreateMetrics []Metric

func (CreateMetrics) Upgrade

func (in CreateMetrics) Upgrade() (types.CreateMetrics, error)

Upgrade transforms the old mspack cmetrics version 0.3.x to the current version.

type Meta

type Meta struct {
	LabelDictionary []string   `json:"label_dictionary" msgpack:"label_dictionary"` // ex: ["foo", "bar", "my-label", "my-value", "name", "dummy.0"]
	Labels          []int      `json:"labels" msgpack:"labels"`                     // Tells which labels are dynamic. Ex: [4]
	Opts            Opts       `json:"opts" msgpack:"opts"`
	StaticLabels    []int      `json:"static_labels" msgpack:"static_labels"` // Tells which labels are static. Ex: [0, 1, 2, 3]
	Type            MetricType `json:"type" msgpack:"type"`
}

type Metric

type Metric struct {
	Meta   Meta    `json:"meta" msgpack:"meta"`
	Values []Value `json:"values" msgpack:"values"`
}

type MetricType

type MetricType int

type Opts

type Opts struct {
	Desc      string `json:"desc" msgpack:"desc"`
	Name      string `json:"name" msgpack:"name"` // ex: "uptime", "bytes_total"
	Namespace string `json:"ns" msgpack:"ns"`     // ex: "fluentbit"
	Subsystem string `json:"ss" msgpack:"ss"`     // ex: "input"
}

type Value

type Value struct {
	// Hash   int64   `json:"hash" msgpack:"hash"`
	Labels []int   `json:"labels" msgpack:"labels"` // Tells the dynamic label value. Ex: [5]
	TS     int64   `json:"ts" msgpack:"ts"`         // nanoseconds
	Value  float64 `json:"value" msgpack:"value"`
}

Jump to

Keyboard shortcuts

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