prom

package
v0.0.0-...-bd7f9dc Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Prom

type Prom struct {
	// contains filtered or unexported fields
}

Prom present prom metrics

You can add metrics like below

SomeGaugeMetric = New().WithState("gauge_metric_name", "gauge metric name", []string{
    labels...
})

and set state via `SomeGaugeMetric.State("gauge_metric_label_name", gauge_value, extra_labels...)`

func New

func New() *Prom

New creates a Prom instance.

func (*Prom) Add

func (p *Prom) Add(name string, v int64, extra ...string)

Add add count v must > 0

func (*Prom) Incr

func (p *Prom) Incr(name string, extra ...string)

Incr increments one stat counter without sampling

func (*Prom) ResetCounter

func (p *Prom) ResetCounter() *Prom

ResetCounter reset counter.

func (*Prom) ResetState

func (p *Prom) ResetState() *Prom

ResetState reset state.

func (*Prom) State

func (p *Prom) State(name string, v int64, extra ...string)

State set state

func (*Prom) Timing

func (p *Prom) Timing(name string, time int64, extra ...string)

Timing log timing information (in milliseconds) without sampling

func (*Prom) WithCounter

func (p *Prom) WithCounter(name, desc string, labels []string) *Prom

WithCounter sets counter.

func (*Prom) WithState

func (p *Prom) WithState(name, desc string, labels []string) *Prom

WithState sets state.

func (*Prom) WithTimer

func (p *Prom) WithTimer(name, desc string, labels []string) *Prom

WithTimer sets timer.

Jump to

Keyboard shortcuts

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