Documentation ¶
Index ¶
- Constants
- func GetAddrFormat(addr string) string
- func GetAddrNextFormat(addr string) string
- type Analysis
- func (a *Analysis) AddTarget(key uint64, interval time.Duration)
- func (a *Analysis) Failure(key uint64)
- func (a *Analysis) GetContinuousFailureCount(server uint64) int
- func (a *Analysis) GetQPS(server uint64, interval time.Duration) int
- func (a *Analysis) GetRecentlyAvg(server uint64, interval time.Duration) int
- func (a *Analysis) GetRecentlyMax(server uint64, interval time.Duration) int
- func (a *Analysis) GetRecentlyMin(server uint64, interval time.Duration) int
- func (a *Analysis) GetRecentlyRejectCount(server uint64, interval time.Duration) int
- func (a *Analysis) GetRecentlyRequestCount(server uint64, interval time.Duration) int
- func (a *Analysis) GetRecentlyRequestFailureCount(server uint64, interval time.Duration) int
- func (a *Analysis) GetRecentlyRequestSuccessedCount(server uint64, interval time.Duration) int
- func (a *Analysis) Reject(key uint64)
- func (a *Analysis) RemoveTarget(key uint64)
- func (a *Analysis) Request(key uint64)
- func (a *Analysis) Response(key uint64, cost int64)
- type FastHTTPClient
- type HTTPOption
- type Recently
Constants ¶
const ( // MinAddrFormat min addr format MinAddrFormat = "000000000000000000000" // MaxAddrFormat max addr format MaxAddrFormat = "255.255.255.255:99999" )
Variables ¶
This section is empty.
Functions ¶
func GetAddrFormat ¶
GetAddrFormat returns addr format for sort, padding left by 0
func GetAddrNextFormat ¶
GetAddrNextFormat returns next addr format for sort, padding left by 0
Types ¶
type Analysis ¶
Analysis analysis struct
func NewAnalysis ¶
func NewAnalysis(tw *goetty.TimeoutWheel) *Analysis
NewAnalysis returns a Analysis
func (*Analysis) GetContinuousFailureCount ¶
GetContinuousFailureCount return Continuous failure request count in spec secs
func (*Analysis) GetRecentlyAvg ¶
GetRecentlyAvg return avg latency in spec secs
func (*Analysis) GetRecentlyMax ¶
GetRecentlyMax return max latency in spec secs
func (*Analysis) GetRecentlyMin ¶
GetRecentlyMin return min latency in spec duration
func (*Analysis) GetRecentlyRejectCount ¶
GetRecentlyRejectCount return reject count in spec duration
func (*Analysis) GetRecentlyRequestCount ¶
GetRecentlyRequestCount return the server request count in spec duration
func (*Analysis) GetRecentlyRequestFailureCount ¶
GetRecentlyRequestFailureCount return failure request count in spec duration
func (*Analysis) GetRecentlyRequestSuccessedCount ¶
GetRecentlyRequestSuccessedCount return successed request count in spec secs
func (*Analysis) RemoveTarget ¶
RemoveTarget remove analysis point on a key
type FastHTTPClient ¶
FastHTTPClient fast http client
func NewFastHTTPClient ¶
func NewFastHTTPClient() *FastHTTPClient
NewFastHTTPClient create FastHTTPClient instance
func NewFastHTTPClientOption ¶
func NewFastHTTPClientOption(defaultOption *HTTPOption) *FastHTTPClient
NewFastHTTPClientOption create FastHTTPClient instance with default option
func (*FastHTTPClient) Do ¶
func (c *FastHTTPClient) Do(req *fasthttp.Request, addr string, option *HTTPOption) (*fasthttp.Response, error)
Do do a http request
type HTTPOption ¶
type HTTPOption struct { // Maximum number of connections which may be established to server MaxConns int // MaxConnDuration Keep-alive connections are closed after this duration. MaxConnDuration time.Duration // MaxIdleConnDuration Idle keep-alive connections are closed after this duration. MaxIdleConnDuration time.Duration // ReadBufferSize Per-connection buffer size for responses' reading. ReadBufferSize int // WriteBufferSize Per-connection buffer size for requests' writing. WriteBufferSize int // ReadTimeout Maximum duration for full response reading (including body). ReadTimeout time.Duration // WriteTimeout Maximum duration for full request writing (including body). WriteTimeout time.Duration // MaxResponseBodySize Maximum response body size. MaxResponseBodySize int }
HTTPOption http client option
func DefaultHTTPOption ¶
func DefaultHTTPOption() *HTTPOption
DefaultHTTPOption returns a HTTP Option