common

package
v1.2.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 半开成功数
	KeyHalfOpenSuccessCount int = iota
	// 半开总请求数
	KeyHalfOpenRequestCount
	// 半开错误统计维度总数
	MaxHalfOpenDimension
)

半开调用结果统计维度

View Source
const (
	ToClose = iota
	ToOpen
	NoChange
)

Variables

This section is empty.

Functions

func GetRequestCountAfterHalfOpen

func GetRequestCountAfterHalfOpen(halfOpenWindow *metric.SliceWindow, timeRange *metric.TimeRange) int64

GetRequestCountAfterHalfOpen 统计半开后的请求分配次数

Types

type HalfOpenConversionHandler

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

HalfOpenConversionHandler 半开状态变更处理器

func NewHalfOpenConversionHandler

func NewHalfOpenConversionHandler(cfg config.Configuration) *HalfOpenConversionHandler

NewHalfOpenConversionHandler 创建半开熔断器

func (*HalfOpenConversionHandler) CreateHalfOpenMetricWindow

func (h *HalfOpenConversionHandler) CreateHalfOpenMetricWindow(name string) *metric.SliceWindow

CreateHalfOpenMetricWindow 创建半开的统计窗口

func (*HalfOpenConversionHandler) GetRecoverBucketInterval

func (h *HalfOpenConversionHandler) GetRecoverBucketInterval() time.Duration

GetRecoverBucketInterval 获取恢复滑桶间隔

func (*HalfOpenConversionHandler) GetRequestCountAfterHalfOpen

func (h *HalfOpenConversionHandler) GetRequestCountAfterHalfOpen() int

GetRequestCountAfterHalfOpen 获取半开后分配的请求数

func (*HalfOpenConversionHandler) HalfOpenConversion

func (h *HalfOpenConversionHandler) HalfOpenConversion(now time.Time, instance model.Instance, cbName string) int

HalfOpenConversion 熔断器的半开状态转换

func (*HalfOpenConversionHandler) OpenToHalfOpen

func (h *HalfOpenConversionHandler) OpenToHalfOpen(instance model.Instance, now time.Time, cbName string) bool

OpenToHalfOpen 熔断器从打开到半开

func (*HalfOpenConversionHandler) StatHalfOpenCalls

func (h *HalfOpenConversionHandler) StatHalfOpenCalls(cbStatus model.CircuitBreakerStatus, gauge model.InstanceGauge) bool

StatHalfOpenCalls 统计半开状态的调用量以及成功失败数 当达到半开次数阈值时,返回true,代表立刻进行状态判断

Jump to

Keyboard shortcuts

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