model

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// COUNTER is a Prometheus COUNTER metric
	COUNTER string = "counter"
	// GAUGE is a Prometheus GAUGE metric
	GAUGE string = "gauge"
	// HISTOGRAM is a Prometheus HISTOGRAM metric
	HISTOGRAM string = "histogram"
	// SUMMARY is a Prometheus SUMMARY metric
	SUMMARY string = "summary"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric struct {
	Type    string            `json:"type"`
	Name    string            `json:"name"`
	Help    string            `json:"help"`
	Method  string            `json:"method"`
	Value   string            `json:"value"`
	Labels  prometheus.Labels `json:"labels"`
	Buckets []float64         `json:"buckets"`
}

Metric struct

func (*Metric) ConvertToJSON

func (m *Metric) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Metric) GetValueAsFloat

func (m *Metric) GetValueAsFloat() (float64, error)

GetValueAsFloat gets a list of label values

func (*Metric) LabelKeys

func (m *Metric) LabelKeys() []string

LabelKeys gets a list of label keys

func (*Metric) LabelValues

func (m *Metric) LabelValues() []string

LabelValues gets a list of label values

func (*Metric) LoadFromJSON

func (m *Metric) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

Jump to

Keyboard shortcuts

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