metrics

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 14 Imported by: 1

Documentation

Overview

Package metrics ...

Package metrics ...

Package metrics ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(key string, delt int64)

Add ...

func AddError

func AddError(key, errCode string, delt int64)

AddError ...

func AddHTTPResponseErr

func AddHTTPResponseErr(err error, moduleName, funcName string)

AddHTTPResponseErr 处理http response err

func AddOneDeltForMultiErrorKeys

func AddOneDeltForMultiErrorKeys(errCode string, keys ...string)

AddOneDeltForMultiErrorKeys ...

func AddOneDeltForMultiKeys

func AddOneDeltForMultiKeys(keys ...string)

AddOneDeltForMultiKeys ...

func Elapsed

func Elapsed(key string, delay time.Duration)

Elapsed ...

func GaugeUpdate

func GaugeUpdate(key string, fv float64)

GaugeUpdate ...

func NewDefault

func NewDefault()

NewDefault ...

func NewWithConfig

func NewWithConfig(sec config.Sectioner) error

NewWithConfig ...

func RPC

func RPC(caller, callee string, elapsed time.Duration, code interface{})

RPC ...

func RPCOk

func RPCOk(caller, callee string, esapled time.Duration, code string)

RPCOk ...

Types

type PrintStruct

type PrintStruct struct {
	Service  string             `json:"service"`
	Endpoint string             `json:"endpoint"`
	Data     map[string]*Result `json:"data,omitempty"`
	Record   []*Record          `json:"record,omitempty"`
}

PrintStruct :Print Struct

type Record

type Record struct {
	Name  string      `json:"name"`
	Tags  Tag         `json:"tags"`
	Ts    int64       `json:"timestamp"`
	Value interface{} `json:"value"`
	Step  int64       `json:"step"`
}

Record ...

type Result

type Result struct {
	Hit int64            `json:"hit"`
	Err map[string]int64 `json:"error"`
	// contains filtered or unexported fields
}

Result :Result struct

type Tag

type Tag struct {
	Service string `json:"service,omitempty"`
	Key     string `json:"api,omitempty"`
	Code    string `json:"code,omitempty"`
	Caller  string `json:"caller,omitempty"`
	Callee  string `json:"callee,omitempty"`
	Percent string `json:"percentile,omitempty"`
}

Tag ...

Jump to

Keyboard shortcuts

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