Documentation ¶
Index ¶
- Constants
- type APICall
- type APICallStatis
- type APICallStatisItem
- type CacheCall
- type CacheCallStatis
- type CacheCallStatisItem
- type ComponentCacheStatics
- type ComponentStatics
- type MetricData
- type PrometheusStatis
- type StatisWorker
- func (s *StatisWorker) AddAPICall(api string, protocol string, code int, duration int64) error
- func (s *StatisWorker) AddCacheCall(component string, cacheType string, miss bool, call int) error
- func (s *StatisWorker) AddRedisCall(api string, code int, duration int64) error
- func (s *StatisWorker) Destroy() error
- func (s *StatisWorker) Initialize(conf *plugin.ConfigEntry) error
- func (s *StatisWorker) Name() string
- func (s *StatisWorker) Run()
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 APICallStatis ¶
type APICallStatis struct {
// contains filtered or unexported fields
}
APICallStatis 接口调用统计
type APICallStatisItem ¶
type APICallStatisItem struct {
// contains filtered or unexported fields
}
APICallStatisItem 接口调用统计条目
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 ¶
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 ¶
AddAPICall 上报请求
func (*StatisWorker) AddCacheCall ¶
AddCacheCall 上报 Cache 指标信息
func (*StatisWorker) AddRedisCall ¶
func (s *StatisWorker) AddRedisCall(api string, code int, duration int64) error
AddRedisCall 上报redis请求
func (*StatisWorker) Initialize ¶
func (s *StatisWorker) Initialize(conf *plugin.ConfigEntry) error
Initialize 初始化统计插件
Click to show internal directories.
Click to hide internal directories.