metric

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServiceName string
	Printer     IPrinter
	Freq        time.Duration
}

type IPrinter

type IPrinter interface {
	Print(m map[string]string)
}

IWriter 打印指标接口

func NewPrinter

func NewPrinter() IPrinter

NewWriter 构造函数

type Metric

type Metric struct {
	ReqCount    metrics.Counter
	ReqDuration metrics.Timer
	// contains filtered or unexported fields
}

Metric 监控指标类

func New

func New(conf *Config) *Metric

New 构造函数

func (*Metric) Start

func (metric *Metric) Start()

Start 开始打印

func (*Metric) Stop

func (metric *Metric) Stop()

Stop 取消打印

Jump to

Keyboard shortcuts

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