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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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