prom

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HTTPServer for http server
	HTTPServerTimer = NewPromTimer("yitu_http_server", []string{"app", "env", "method"})

	HTTPServerCounter = NewPromCounter("yitu_http_server_code", []string{"app", "env", "method", "code"})

	AppBuildInfo = NewPromCounter("yitu_app_build_info", []string{"app", "env", "version"})
)

Functions

func Register added in v0.2.0

func Register() common.Caller

Types

type Cfg added in v0.2.0

type Cfg struct {
}

type PromCounter

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

func NewPromCounter

func NewPromCounter(name string, labels []string) *PromCounter

func (*PromCounter) Add

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

Add add count v must > 0

func (*PromCounter) Decr

func (p *PromCounter) Decr(name string, extra ...string)

Decr decrements one stat counter without sampling

func (*PromCounter) Incr

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

Incr increments one stat counter without sampling

func (*PromCounter) Set

func (p *PromCounter) Set(name string, extra ...string)

type PromTimer

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

Prom struct info

func NewPromTimer

func NewPromTimer(name string, labels []string) *PromTimer

New creates a Prom instance.

func (*PromTimer) Timing

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

Timing log timing information (in milliseconds) without sampling

Jump to

Keyboard shortcuts

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