local

package
v1.13.5 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 11 Imported by: 0

README

统计打印到本地日志

Documentation

Index

Constants

View Source
const (
	// metric name
	MetricForClientRqTotal         string = "client_rq_total"
	MetricForClientRqFailure       string = "client_rq_failure"
	MetricForClientRqTimeout       string = "client_rq_timeout"
	MetricForClientRqIntervalCount string = "client_rq_interval_count"
	MetricForClientRqTimeoutMin    string = "client_rq_timeout_min"
	MetricForClientRqTimeoutAvg    string = "client_rq_timeout_avg"
	MetricForClientRqTimeoutMax    string = "client_rq_timeout_max"
	MetricForClientRqTimeoutP99    string = "client_rq_timeout_p99"

	// metric label
	LabelForPolarisServerInstance string = "polaris_server_instance"
	LabelForApi                   string = "api"
	LabelForProtocol              string = "protocol"
	LabelForErrCode               string = "err_code"

	// metric type
	TypeForCounterVec   string = "counter_vec"
	TypeForGaugeVec     string = "gauge_vec"
	TypeForHistogramVec string = "histogram_vec"
)
View Source
const (
	PluginName = "local"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APICall

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

APICall 接口调用

type APICallStatis

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

APICallStatis 接口调用统计

type APICallStatisItem

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

APICallStatisItem 接口调用统计条目

type CacheCall

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

CacheCall 接口调用

type CacheCallStatis

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

CacheCallStatis 接口调用统计

type CacheCallStatisItem

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

CacheCallStatisItem 接口调用统计条目

type ComponentCacheStatics

type ComponentCacheStatics struct {
	CacheCallStatis *CacheCallStatis
	// contains filtered or unexported fields
}

ComponentCacheStatics statics components

type ComponentStatics

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

ComponentStatics statics components

type MetricData

type MetricData struct {
	Name       string
	Data       float64
	Labels     map[string]string
	DeleteFlag bool
}

MetricData metric 结构体

type PrometheusStatis

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

PrometheusStatis is a struct for prometheus statistics

func NewPrometheusStatis

func NewPrometheusStatis() (*PrometheusStatis, error)

NewPrometheusStatis 初始化 PrometheusStatis

func (*PrometheusStatis) GetRegistry

func (s *PrometheusStatis) GetRegistry() *prometheus.Registry

GetRegistry return prometheus.Registry instance

type StatisWorker

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

StatisWorker 本地统计插件

func (*StatisWorker) AddAPICall

func (s *StatisWorker) AddAPICall(api string, protocol string, code int, duration int64) error

AddAPICall 上报请求

func (*StatisWorker) AddCacheCall

func (s *StatisWorker) AddCacheCall(component string, cacheType string, miss bool, call int) error

AddCacheCall 上报 Cache 指标信息

func (*StatisWorker) AddRedisCall

func (s *StatisWorker) AddRedisCall(api string, code int, duration int64) error

AddRedisCall 上报redis请求

func (*StatisWorker) Destroy

func (s *StatisWorker) Destroy() error

Destroy 销毁统计插件

func (*StatisWorker) Initialize

func (s *StatisWorker) Initialize(conf *plugin.ConfigEntry) error

Initialize 初始化统计插件

func (*StatisWorker) Name

func (s *StatisWorker) Name() string

Name 获取统计插件名称

func (*StatisWorker) Run

func (s *StatisWorker) Run()

Run 主流程

Jump to

Keyboard shortcuts

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