emetric

package
Version: v0.6.16 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: MIT Imports: 3 Imported by: 6

README

metric

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TypeHTTP ...
	TypeHTTP = "http"
	// TypeGRPCUnary ...
	TypeGRPCUnary = "unary"
	// TypeGRPCStream ...
	TypeGRPCStream = "stream"
	// TypeRedis ...
	TypeRedis = "redis"
	// TypeGorm ...
	TypeGorm = "gorm"
	// TypeWebsocket ...
	TypeWebsocket = "ws"

	// TypeMySQL ...
	TypeMySQL = "mysql"

	// CodeJobSuccess ...
	CodeJobSuccess = "ok"
	// CodeJobFail ...
	CodeJobFail = "fail"
	// CodeJobReentry ...
	CodeJobReentry = "reentry"

	// CodeCacheMiss ...
	CodeCacheMiss = "miss"
	// CodeCacheHit ...
	CodeCacheHit = "hit"

	// DefaultNamespace ...
	DefaultNamespace = "ego"
)
View Source
var (
	// ServerHandleCounter ...
	ServerHandleCounter = CounterVecOpts{
		Namespace: DefaultNamespace,
		Name:      "server_handle_total",
		Labels:    []string{"type", "method", "peer", "code", "uniform_code"},
	}.Build()

	// ServerHandleHistogram ...
	ServerHandleHistogram = HistogramVecOpts{
		Namespace: DefaultNamespace,
		Name:      "server_handle_seconds",
		Labels:    []string{"type", "method", "peer"},
	}.Build()

	// ClientHandleCounter ...
	ClientHandleCounter = CounterVecOpts{
		Namespace: DefaultNamespace,
		Name:      "client_handle_total",
		Labels:    []string{"type", "name", "method", "peer", "code"},
	}.Build()

	// ClientHandleHistogram ...
	ClientHandleHistogram = HistogramVecOpts{
		Namespace: DefaultNamespace,
		Name:      "client_handle_seconds",
		Labels:    []string{"type", "name", "method", "peer"},
	}.Build()

	// JobHandleCounter ...
	JobHandleCounter = CounterVecOpts{
		Namespace: DefaultNamespace,
		Name:      "job_handle_total",
		Labels:    []string{"type", "name", "code"},
	}.Build()

	// JobHandleHistogram ...
	JobHandleHistogram = HistogramVecOpts{
		Namespace: DefaultNamespace,
		Name:      "job_handle_seconds",
		Labels:    []string{"type", "name"},
	}.Build()
	// LibHandleHistogram ...
	LibHandleHistogram = HistogramVecOpts{
		Namespace: DefaultNamespace,
		Name:      "lib_handle_seconds",
		Labels:    []string{"type", "method", "address"},
	}.Build()
	// LibHandleCounter ...
	LibHandleCounter = CounterVecOpts{
		Namespace: DefaultNamespace,
		Name:      "lib_handle_total",
		Labels:    []string{"type", "method", "address", "code"},
	}.Build()
	// LibHandleSummary ...
	LibHandleSummary = SummaryVecOpts{
		Namespace: DefaultNamespace,
		Name:      "lib_handle_stats",
		Labels:    []string{"name", "status"},
	}.Build()

	// CacheHandleCounter ...
	CacheHandleCounter = CounterVecOpts{
		Namespace: DefaultNamespace,
		Name:      "cache_handle_total",
		Labels:    []string{"type", "name", "action", "code"},
	}.Build()

	// CacheHandleHistogram ...
	CacheHandleHistogram = HistogramVecOpts{
		Namespace: DefaultNamespace,
		Name:      "cache_handle_seconds",
		Labels:    []string{"type", "name", "action"},
	}.Build()

	// BuildInfoGauge ...
	BuildInfoGauge = GaugeVecOpts{
		Namespace: DefaultNamespace,
		Name:      "build_info",
		Labels:    []string{"name", "mode", "region", "zone", "app_version", "ego_version", "start_time", "build_time", "go_version"},
	}.Build()
)

Functions

This section is empty.

Types

type CounterVec added in v0.4.0

type CounterVec struct {
	*prometheus.CounterVec
}

CounterVec ...

func NewCounterVec

func NewCounterVec(name string, labels []string) *CounterVec

NewCounterVec ...

func (*CounterVec) Add added in v0.4.0

func (counter *CounterVec) Add(v float64, labels ...string)

Add ...

func (*CounterVec) Inc added in v0.4.0

func (counter *CounterVec) Inc(labels ...string)

Inc ...

type CounterVecOpts

type CounterVecOpts struct {
	Namespace string
	Subsystem string
	Name      string
	Help      string
	Labels    []string
}

CounterVecOpts ...

func (CounterVecOpts) Build

func (opts CounterVecOpts) Build() *CounterVec

Build ...

type GaugeVec added in v0.4.0

type GaugeVec struct {
	*prometheus.GaugeVec
}

GaugeVec ...

func NewGaugeVec

func NewGaugeVec(name string, labels []string) *GaugeVec

NewGaugeVec ...

func (*GaugeVec) Add added in v0.4.0

func (gv *GaugeVec) Add(v float64, labels ...string)

Add ...

func (*GaugeVec) Inc added in v0.4.0

func (gv *GaugeVec) Inc(labels ...string)

Inc ...

func (*GaugeVec) Set added in v0.4.0

func (gv *GaugeVec) Set(v float64, labels ...string)

Set ...

type GaugeVecOpts

type GaugeVecOpts struct {
	Namespace string
	Subsystem string
	Name      string
	Help      string
	Labels    []string
}

GaugeVecOpts ...

func (GaugeVecOpts) Build

func (opts GaugeVecOpts) Build() *GaugeVec

Build ...

type HistogramVec added in v0.4.0

type HistogramVec struct {
	*prometheus.HistogramVec
}

HistogramVec ...

func (*HistogramVec) Observe added in v0.4.0

func (histogram *HistogramVec) Observe(v float64, labels ...string)

Observe ...

type HistogramVecOpts

type HistogramVecOpts struct {
	Namespace string
	Subsystem string
	Name      string
	Help      string
	Labels    []string
	Buckets   []float64
}

HistogramVecOpts ...

func (HistogramVecOpts) Build

func (opts HistogramVecOpts) Build() *HistogramVec

Build ...

type SummaryVec added in v0.4.0

type SummaryVec struct {
	*prometheus.SummaryVec
}

SummaryVec ...

func (*SummaryVec) Observe added in v0.4.0

func (summary *SummaryVec) Observe(v float64, labels ...string)

Observe ...

type SummaryVecOpts

type SummaryVecOpts struct {
	Namespace  string
	Subsystem  string
	Name       string
	Help       string
	Objectives map[float64]float64
	Labels     []string
}

SummaryVecOpts ...

func (SummaryVecOpts) Build

func (opts SummaryVecOpts) Build() *SummaryVec

Build ...

Jump to

Keyboard shortcuts

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