Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct { Hll *HyperLogLog // Now - artifical now of the incoming data reprents the first timestamp of the open interval. Now int }
Counter that stors unique users per minute. The main structure is a HyperLogLog counter and the starting epoh time - The first incoming message. This implementation assumes messages are ordered.
type HyperLogLog ¶
type HyperLogLog struct {
// contains filtered or unexported fields
}
A HyperLogLog cardinality estimator. See http://algo.inria.fr/flajolet/Publications/FlFuGaMe07.pdf for details about the algorithm.
func NewHyperLogLog ¶
func NewHyperLogLog(stdErr float64) *HyperLogLog
NewHyperLogLog returns an estimator for counting cardinality to within the given stderr.
Smaller values require more space, but provide more accurate results. For a good time, try 0.001 or so.
func (*HyperLogLog) Count ¶
func (h *HyperLogLog) Count() uint64
Count returns the current estimate of the number of distinct items seen.
func (*HyperLogLog) Merge ¶
func (h *HyperLogLog) Merge(from *HyperLogLog)
Merge another HyperLogLog into this one.