kratos: Index | Files

package prom

import ""


Package Files



var (
    // LibClient for mc redis and db client.
    LibClient = New().WithTimer("go_lib_client", []string{"method"}).WithCounter("go_lib_client_code", []string{"method", "code"})
    // RPCClient rpc client
    RPCClient = New().WithTimer("go_rpc_client", []string{"method"}).WithCounter("go_rpc_client_code", []string{"method", "code"})
    // HTTPClient http client
    HTTPClient = New().WithTimer("go_http_client", []string{"method"}).WithCounter("go_http_client_code", []string{"method", "code"})
    // HTTPServer for http server
    HTTPServer = New().WithTimer("go_http_server", []string{"user", "method"}).WithCounter("go_http_server_code", []string{"user", "method", "code"})
    // RPCServer for rpc server
    RPCServer = New().WithTimer("go_rpc_server", []string{"user", "method"}).WithCounter("go_rpc_server_code", []string{"user", "method", "code"})
    // BusinessErrCount for business err count
    BusinessErrCount = New().WithCounter("go_business_err_count", []string{"name"}).WithState("go_business_err_state", []string{"name"})
    // BusinessInfoCount for business info count
    BusinessInfoCount = New().WithCounter("go_business_info_count", []string{"name"}).WithState("go_business_info_state", []string{"name"})
    // CacheHit for cache hit
    CacheHit = New().WithCounter("go_cache_hit", []string{"name"})
    // CacheMiss for cache miss
    CacheMiss = New().WithCounter("go_cache_miss", []string{"name"})

type Prom Uses

type Prom struct {
    // contains filtered or unexported fields

Prom struct info

func New Uses

func New() *Prom

New creates a Prom instance.

func (*Prom) Add Uses

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

Add add count v must > 0

func (*Prom) Decr Uses

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

Decr decrements one stat counter without sampling

func (*Prom) Incr Uses

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

Incr increments one stat counter without sampling

func (*Prom) State Uses

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

State set state

func (*Prom) Timing Uses

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

Timing log timing information (in milliseconds) without sampling

func (*Prom) WithCounter Uses

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

WithCounter sets counter.

func (*Prom) WithState Uses

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

WithState sets state.

func (*Prom) WithTimer Uses

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

WithTimer with summary timer

Package prom imports 4 packages (graph) and is imported by 4 packages. Updated 2019-05-04. Refresh now. Tools for package owners.