Documentation
¶
Overview ¶
Package hypercount 面向对象的计数估计类型 HyperCount 用于粗略统计大量数据去重后的个数,一般用在日活计算
Index ¶
- type HyperCount
- func (c *HyperCount) Add(ctx context.Context, item interface{}) error
- func (c *HyperCount) AddM(ctx context.Context, items ...interface{}) error
- func (c *HyperCount) Len(ctx context.Context) (int64, error)
- func (c *HyperCount) Reset(ctx context.Context) error
- func (c *HyperCount) Union(ctx context.Context, targetbmkey *clientkey.ClientKey, otherbm *HyperCount) (*HyperCount, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HyperCount ¶
HyperCount 估计计数对象
func New ¶
func New(k *clientkey.ClientKey) *HyperCount
New 创建一个新的计数对象 @params k *key.Key redis客户端的键对象
func (*HyperCount) Add ¶
func (c *HyperCount) Add(ctx context.Context, item interface{}) error
Add 添加数据 @params ctx context.Context 上下文信息,用于控制请求的结束 @params item interface{} 添加的数据
func (*HyperCount) AddM ¶
func (c *HyperCount) AddM(ctx context.Context, items ...interface{}) error
AddM 添加数据 @params ctx context.Context 上下文信息,用于控制请求的结束 @params items ...interface{} 添加的数据
func (*HyperCount) Len ¶
func (c *HyperCount) Len(ctx context.Context) (int64, error)
Len 检查HyperLogLog中不重复元素的个数 @params ctx context.Context 上下文信息,用于控制请求的结束
func (*HyperCount) Reset ¶
func (c *HyperCount) Reset(ctx context.Context) error
Reset 重置当前hypercount @params ctx context.Context 上下文信息,用于控制请求的结束
func (*HyperCount) Union ¶
func (c *HyperCount) Union(ctx context.Context, targetbmkey *clientkey.ClientKey, otherbm *HyperCount) (*HyperCount, error)
Union 对应set的求并集操作 @params ctx context.Context 上下文信息,用于控制请求的结束 @params targetbmkey *clientkey.ClientKey 目标key对象 @params otherbms ...*Bitmap 与之做并操作的其他bitmap对象
Click to show internal directories.
Click to hide internal directories.