exposition

package
v0.12.17 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Counter Type = "counter"
	Gauge        = "gauge"
	Summary      = "summary"
)

Metric types

Variables

This section is empty.

Functions

func ToFloat

func ToFloat(v reflect.Value) float64

ToFloat converts a reflect.Value to float64

Types

type Exposition

type Exposition struct {
	Name string
	Type Type
	Rows []Row
}

Exposition for tracking/formatting counters

func New

func New(name string, expType Type) (e Exposition)

New creates a new Exposition

func (*Exposition) AddRow

func (e *Exposition) AddRow(value float64) *Row

AddRow creates a row on exposition

func (Exposition) String

func (e Exposition) String() string

String outputs a string reprisentation

type Expositioner

type Expositioner interface {
	Exposition() Expositions
}

Expositioner converts a stat object into a list of expositions.

type Expositions

type Expositions []Exposition

Expositions list of Expositions

func (Expositions) String

func (e Expositions) String() string

String outputs a string reprisentation

func (Expositions) ToSpaceValues

func (e Expositions) ToSpaceValues() (lis []mercury.Value)

ToSpaceValues Convert Exposition to Mercury Space

type Row

type Row struct {
	Tags  Tags
	Value float64
}

Row is a line item

func (*Row) AddTag

func (row *Row) AddTag(name, value string) *Row

AddTag adds a tag to a row

func (Row) String

func (row Row) String() string

String outputs a string reprisentation

type Tags

type Tags map[string]string

Tags for counter differentiation

type Type

type Type string

Type for metric counter type

Jump to

Keyboard shortcuts

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