util

package
v0.0.0-...-8bebed1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MODULE_REGISTRY     = "[registry]:"
	MODULE_FRONTEND_TCP = "[frontend-tcp]:"
	MODULE_BACKEND      = "[backend]:"
	MODULE_SERVICE      = "[service]:"
	MODULE_ROUTING      = "[routing]:"
	MODULE_CONNECTION   = "[connection]:"
)

Variables

View Source
var (
	TimeWheel = goetty.NewHashedTimeWheel(time.Millisecond, 60, 3)
)

Functions

func ConvertToIp

func ConvertToIp(addr string) string

func GetTimeWheel

func GetTimeWheel() *goetty.HashedTimeWheel

func Init

func Init()

func NewRedisPool

func NewRedisPool(servers []string, maxIdle int, idleTimeout time.Duration) *redis.Pool

Types

type Analysis

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

func NewAnalysis

func NewAnalysis() *Analysis

func (*Analysis) AddRecent

func (self *Analysis) AddRecent(key string, secs int)

func (*Analysis) GetQPS

func (self *Analysis) GetQPS(server string, secs int) int

func (*Analysis) GetRecentlyCount

func (self *Analysis) GetRecentlyCount(server string, secs int) int

func (*Analysis) Request

func (self *Analysis) Request(key string)

type Recently

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

Jump to

Keyboard shortcuts

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