metrics

package
v0.0.0-...-e67e6ae Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MtcMessageUp      = "pub"
	MtcMessageDown    = "sub"
	MtcMessageAPIDown = "api"
	MtcRouteMessage   = "route"
	MtcRule           = "rule"
	MtcRuleInvoke     = "rule_invoke"
	MtcRuleOK         = "rule_ok"
	MtcRuleFAIL       = "rule_fail"
	MtcRuleAction     = "rule_action"
	MtcRuleActionOK   = "rule_action_ok"
	MtcRuleActionFAIL = "rule_action_fail"
)

1 消息上行 pub 当前用户ID 设备ID 2 消息下行 sub 当前用户ID 设备ID 3 通过API下行 api 当前用户ID 设备ID 4 规则引擎 rule 当前用户ID 规则ID 5 规则引擎-处理成功 rule_ok 当前用户ID 规则ID 6 规则引擎-处理失败 rule_fail 当前用户ID 规则ID 7 规则引擎-动作处理 rule_action 当前用户ID 规则ID 8 规则引擎-动作处理-成功 rule_action_ok 当前用户ID 规则ID 9 规则引擎-动作处理-失败 rule_action_fail 当前用户ID 规则ID

Variables

View Source
var (
	RuleMetrics = gometrics.NewMeter()
	MsgMetrics  = gometrics.NewMeter()
)

Functions

func Dec

func Dec(metric string)

func Inc

func Inc(metric string)

func InitMetrics

func InitMetrics(sink xstream.Sink)

func Log

func Log(freq time.Duration, fn PrintFun)

func LogScaled

func LogScaled(r Registry, freq time.Duration, scale time.Duration, fn PrintFun)

Output each metric in the given registry periodically using the given logger. Print timings in `scale` units (eg time.Millisecond) rather than nanos.

func MetricName

func MetricName(userID, key, MetricType string) string

func Register

func Register(name string, i interface{}) error

Types

type Counter

type Counter gometrics.Counter

func NewCounter

func NewCounter() Counter

NewCounter constructs a new StandardCounter.

type Gauge

type Gauge gometrics.Gauge

func NewGauge

func NewGauge() Gauge

NewCounter constructs a new StandardCounter.

type GaugeFloat64

type GaugeFloat64 gometrics.GaugeFloat64

func NewGaugeFloat64

func NewGaugeFloat64() GaugeFloat64

NewCounter constructs a new StandardCounter.

type Healthcheck

type Healthcheck gometrics.Healthcheck

type Histogram

type Histogram gometrics.Histogram

type Logger

type Logger gometrics.Logger

type Meter

type Meter gometrics.Meter

func NewMeter

func NewMeter() Meter

NewCounter constructs a new StandardCounter.

type PrintFun

type PrintFun func(msg string, fields ...zapcore.Field)

type Registry

type Registry gometrics.Registry

type Timer

type Timer gometrics.Timer

func NewTimer

func NewTimer() Timer

NewCounter constructs a new StandardCounter.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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