class Dumpster::Counter(T)

Overview

Util for tracking a set of counters associated with keys of an arbitary type.

OPTIMIZE depending on number of entries being tracked, there may be a point where it make sense to swap this out for a count-min-sketch, but a Hash is simple for now...

Defined in:

dumpster/counter.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def count(key : T) : Count #

[View source]
def each(*args, **options) #

[View source]
def each(*args, **options, &) #

[View source]
def increment(key : T) : Count #

[View source]