resource

package
v0.0.117 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CallerMethodKey = attribute.Key("caller_method") // caller method
	CalleeMethodKey = attribute.Key("callee_method") // callee method
	PodIpKey        = attribute.Key("pod_ip")        // pod ip
	ServerNameKey   = attribute.Key("server_name")   // server name
	ErrorCodeKey    = attribute.Key("error_code")    // error code
)

dims

View Source
var (
	DefaultMetricMonitor = NewMetricMonitor()
)

Functions

func Attrs

func Attrs(dim Dimension) []attribute.KeyValue

func ReportMetric added in v0.0.102

func ReportMetric(ctx context.Context, dim Dimension, costTime time.Duration)

Types

type Dimension

type Dimension struct {
	CalleeMethod string
	Error        error
}

type HandlerWithContext added in v0.0.105

type HandlerWithContext[REQ any, RESP any] func(context.Context, REQ) (RESP, error)

type MetricMonitor

type MetricMonitor struct {
	TotalReqCounter   syncint64.Counter
	FailCntCounter    syncint64.Counter
	CostTimeHistogram syncfloat64.Histogram
}

func NewMetricMonitor

func NewMetricMonitor() *MetricMonitor

Jump to

Keyboard shortcuts

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