Back to godoc.org

Package qpslimiter

v0.7.1
Latest Go to latest
Published: Aug 16, 2018 | License: Apache-2.0 | Module: github.com/serviceComb/go-chassis

Index

Package Files

Constants

const (
	DefaultRate = 2147483647
)

constant qps default rate

func GetQPSRate

func GetQPSRate(rateConfig string) (int, bool)

GetQPSRate get qps rate

func GetSpecificKey

func GetSpecificKey(sourceName, serviceType, serviceName, schemaID, OperationID string) string

GetSpecificKey get specific key

type OperationMeta

type OperationMeta struct {
	MicroServiceName       string
	SchemaQualifiedName    string
	OperationQualifiedName string
}

OperationMeta operation meta struct

func InitSchemaOperations

func InitSchemaOperations(i *invocation.Invocation) *OperationMeta

InitSchemaOperations initialize schema operations

func (*OperationMeta) GetMicroServiceName

func (op *OperationMeta) GetMicroServiceName() string

GetMicroServiceName get micro-service name

func (*OperationMeta) GetMicroServiceSchemaOpQualifiedName

func (op *OperationMeta) GetMicroServiceSchemaOpQualifiedName() string

GetMicroServiceSchemaOpQualifiedName get micro-service schema operation qualified name

func (*OperationMeta) GetSchemaQualifiedName

func (op *OperationMeta) GetSchemaQualifiedName() string

GetSchemaQualifiedName get schema qualified name

type QPSLimiterMap

type QPSLimiterMap struct {
	KeyMap map[string]ratelimit.Limiter
	sync.RWMutex
}

QPSLimiterMap qps limiter map struct

func GetQPSTrafficLimiter

func GetQPSTrafficLimiter() *QPSLimiterMap

GetQPSTrafficLimiter get qps traffic limiter

func (*QPSLimiterMap) DeleteRateLimiter

func (qpsL *QPSLimiterMap) DeleteRateLimiter(key string)

DeleteRateLimiter delete rate limiter

func (*QPSLimiterMap) GetQPSRateWithPriority

func (qpsL *QPSLimiterMap) GetQPSRateWithPriority(op *OperationMeta) (int, string)

GetQPSRateWithPriority get qps rate with priority

func (*QPSLimiterMap) ProcessDefaultRateRpsTokenReq

func (qpsL *QPSLimiterMap) ProcessDefaultRateRpsTokenReq(key string, qpsRate int)

ProcessDefaultRateRpsTokenReq process default rate pps token request

func (*QPSLimiterMap) ProcessQPSTokenReq

func (qpsL *QPSLimiterMap) ProcessQPSTokenReq(key string, qpsRate int)

ProcessQPSTokenReq process qps token request

func (*QPSLimiterMap) UpdateRateLimit

func (qpsL *QPSLimiterMap) UpdateRateLimit(key string, value interface{})

UpdateRateLimit update rate limit

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier