sampler

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sampler

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

func New

func New(tick time.Duration, first, thereafter int) *Sampler

每tick间隔内: 1. 对前first个请求返回true 2. 之后开始采样,采样率为1/thereafter

func (*Sampler) Check

func (s *Sampler) Check(now time.Time) bool

Jump to

Keyboard shortcuts

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