Documentation
¶
Index ¶
- type HotKey
- type HotKeyMgr
- func (hkm *HotKeyMgr) AddRequest(key string)
- func (hkm *HotKeyMgr) GetHotKeyCache() map[string]int64
- func (hkm *HotKeyMgr) GetHotKeyFromCache(key string) (int64, bool)
- func (hkm *HotKeyMgr) MergeBucketsToHeap()
- func (hkm *HotKeyMgr) Start(topK, threshold int, duration time.Duration)
- func (hkm *HotKeyMgr) UpdateTopK(topK int, threshold int64)
- type MaxHeap
- type SliderWindow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HotKeyMgr ¶
type HotKeyMgr struct {
// contains filtered or unexported fields
}
func (*HotKeyMgr) AddRequest ¶
func (*HotKeyMgr) GetHotKeyCache ¶
func (*HotKeyMgr) GetHotKeyFromCache ¶
func (*HotKeyMgr) MergeBucketsToHeap ¶
func (hkm *HotKeyMgr) MergeBucketsToHeap()
func (*HotKeyMgr) UpdateTopK ¶
type SliderWindow ¶
type SliderWindow struct {
// contains filtered or unexported fields
}
func NewSliderWindow ¶
func NewSliderWindow(size int, windowsDuration time.Duration) *SliderWindow
func (*SliderWindow) GetBucketIndex ¶
func (sw *SliderWindow) GetBucketIndex(currentTime int64) int
func (*SliderWindow) MergeBucketsToHeap ¶
func (sw *SliderWindow) MergeBucketsToHeap(h *MaxHeap)
MergeBucketsToHeap 将所有桶中的商品数据合并到大顶堆中
Click to show internal directories.
Click to hide internal directories.