hedis
Safe HaskellNone
LanguageHaskell2010

Database.Redis.ManualCommands.Topk

Synopsis

Documentation

data TopkInfo Source #

Constructors

TopkInfo 

Fields

Instances

Instances details
Show TopkInfo Source # 
Instance details

Defined in Database.Redis.ManualCommands.Topk

Eq TopkInfo Source # 
Instance details

Defined in Database.Redis.ManualCommands.Topk

RedisResult TopkInfo Source # 
Instance details

Defined in Database.Redis.ManualCommands.Topk

topkAdd Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key of the Top-K sketch.

-> NonEmpty ByteString

Items to add.

-> m (f [Maybe ByteString]) 

Adds one or more items to a Top-K sketch (https://redis.io/commands/topk.add).

Returns the items dropped from the sketch after each insertion, or Nothing when no item was expelled.

O(n cdot d), where n is the number of items and d is the depth of the sketch.

Since RedisBloom 2.0.0

topkCount Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key of the Top-K sketch.

-> NonEmpty ByteString

Items to count.

-> m (f [Integer]) 

Returns the count for one or more items in a Top-K sketch (https://redis.io/commands/topk.count).

Returns 0 for items that are not tracked by the sketch.

O(n cdot d), where n is the number of items and d is the depth of the sketch.

Since RedisBloom 2.0.0

topkIncrby Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key of the Top-K sketch.

-> NonEmpty (ByteString, Integer)

Item and increment pairs.

-> m (f [Maybe ByteString]) 

Increments the count of one or more items by a configured amount (https://redis.io/commands/topk.incrby).

Returns the items dropped from the sketch after each increment, or Nothing when no item was expelled.

O(n cdot d), where n is the number of item-increment pairs and d is the depth of the sketch.

Since RedisBloom 2.0.0

Since RedisBloom 2.0.0

topkInfo Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key of the Top-K sketch.

-> m (f TopkInfo) 

topkList Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key of the Top-K sketch.

-> m (f [ByteString]) 

Returns the items in a Top-K sketch (https://redis.io/commands/topk.list).

O(k), where k is the configured top-k size.

Since RedisBloom 2.0.0

topkListWithCount Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key of the Top-K sketch.

-> m (f [(ByteString, Integer)]) 

Returns the items in a Top-K sketch along with their approximated counts (https://redis.io/commands/topk.list).

O(k), where k is the configured top-k size.

Since RedisBloom 2.0.0

topkReserve Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key of the Top-K sketch to create.

-> Integer

Number of items to keep in the sketch.

-> Integer

Number of counters in each array.

-> Integer

Number of counter arrays.

-> Double

Decay factor.

-> m (f Status) 

Creates an empty Top-K sketch (https://redis.io/commands/topk.reserve).

The sketch will fail to be created if the key already exists.

O(1)

Since RedisBloom 2.0.0

topkQuery Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key of the Top-K sketch.

-> NonEmpty ByteString

Items to check.

-> m (f [Bool]) 

Checks whether one or more items are present in a Top-K sketch (https://redis.io/commands/topk.query).

A False value means the item is not currently one of the tracked heavy hitters.

O(n cdot d), where n is the number of items and d is the depth of the sketch.

Since RedisBloom 2.0.0