func WithCPUThreshold(threshold int64) Option {
	return func(o *options) {
		o.CPUThreshold = threshold
	}
}
WithCPUThreshold with cpu threshold;
package bbr
import (
	"math"
	"sync/atomic"
	"time"
	"github.com/go-kratos/aegis/pkg/cpu"
	"github.com/go-kratos/aegis/pkg/window"
	"github.com/go-kratos/aegis/ratelimit"
)
var (
	gCPU  int64
	decay = 0.95
	_ ratelimit.Limiter = &BBR{}
)
type (
	cpuGetter func() int64
	Option func(*options)
)
func init() {
	go cpuproc()
}
func cpuproc() {
	ticker := time.NewTicker(time.Millisecond * 500)  
	defer func() {
		ticker.Stop()
		if err := recover(); err != nil {
			go cpuproc()
		}
	}()
	for range ticker.C {
		stat := &cpu.Stat{}
		cpu.ReadStat(stat)
		prevCPU := atomic.LoadInt64(&gCPU)
		curCPU := int64(float64(prevCPU)*decay + float64(stat.Usage)*(1.0-decay))
		atomic.StoreInt64(&gCPU, curCPU)
	}
}
type Stat struct {
	CPU         int64
	InFlight    int64
	MaxInFlight int64
	MinRt       int64
	MaxPass     int64
}
type counterCache struct {
	val  int64
	time time.Time
}
type options struct {
	Window time.Duration
	Bucket int
	CPUThreshold int64
}
func WithWindow(d time.Duration) Option {
	return func(o *options) {
		o.Window = d
	}
}
func WithBucket(b int) Option {
	return func(o *options) {
		o.Bucket = b
	}
}