jkmetric

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Throughput = "throughput"
	Latency    = "latency"
	Error      = "error"
	Value      = "value"
)

Variables

View Source
var (
	MetricsIns = &MetricsImpl{}
)

Functions

This section is empty.

Types

type MetricsClient

type MetricsClient interface {
	EmitCounter(name string, value interface{}, tags map[string]string) error
	EmitTimer(name string, value interface{}, tags map[string]string) error
	EmitStore(name string, value interface{}, tags map[string]string) error
}

MetricsClient 打点支持,不定义具体的实现,通过SetMetricsClient注入,注入的对象务必实现了该接口

func SetMetricsClient

func SetMetricsClient(client interface{}) MetricsClient

type MetricsImpl

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

func (*MetricsImpl) EmitCounter

func (m *MetricsImpl) EmitCounter(name string, value interface{}, tags map[string]string) error

func (*MetricsImpl) EmitStore

func (m *MetricsImpl) EmitStore(name string, value interface{}, tags map[string]string) error

func (*MetricsImpl) EmitTimer

func (m *MetricsImpl) EmitTimer(name string, value interface{}, tags map[string]string) error

Jump to

Keyboard shortcuts

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