func (w *HotCache) CheckWriteAsync(task FlowItemTask) bool {
	select {
	case w.writeFlowQueue <- task:
		return true
	default:
		return false
	}
}
CheckWriteAsync puts the flowItem into queue, and check it asynchronously
package statistics
import (
	"context"
	"github.com/tikv/pd/server/core"
)
var Denoising = true
const queueCap = 20000
type HotCache struct {
	ctx            context.Context
	quit           <-chan struct{}
	readFlowQueue  chan FlowItemTask
	writeFlowQueue chan FlowItemTask
	writeFlow      *hotPeerCache
	readFlow       *hotPeerCache
}
func NewHotCache(ctx context.Context, quit <-chan struct{}) *HotCache {
	w := &HotCache{
		ctx:            ctx,
		quit:           quit,
		readFlowQueue:  make(chan FlowItemTask, queueCap),
		writeFlowQueue: make(chan FlowItemTask, queueCap),
		writeFlow:      NewHotPeerCache(WriteFlow),
		readFlow:       NewHotPeerCache(ReadFlow),
	}
	go w.updateItems(w.readFlowQueue, w.runReadTask)
	go w.updateItems(w.writeFlowQueue, w.runWriteTask)
	return w
}
func (w *HotCache) CheckWritePeerSync(peer *core.PeerInfo, region *core.RegionInfo) *HotPeerStat {
	return w.writeFlow.CheckPeerFlow(peer, region)
}
func (w *HotCache) CheckReadPeerSync(peer *core.PeerInfo, region *core.RegionInfo) *HotPeerStat {
	return w.readFlow.CheckPeerFlow(peer, region)
}