Module: Hyll

Defined in:
lib/hyll.rb,
lib/hyll/factory.rb,
lib/hyll/version.rb,
lib/hyll/constants.rb,
lib/hyll/utils/hash.rb,
lib/hyll/utils/math.rb,
lib/hyll/algorithms/hyperloglog.rb,
lib/hyll/algorithms/enhanced_hyperloglog.rb

Defined Under Namespace

Modules: Constants, Utils Classes: EnhancedHyperLogLog, Error, Factory, HyperLogLog

Constant Summary collapse

VERSION =
"0.2.0"

Class Method Summary collapse

Class Method Details

.deserialize(data) ⇒ HyperLogLog, EnhancedHyperLogLog

Shorthand method to deserialize a HyperLogLog counter

Parameters:

  • data (String)

    the serialized data

Returns:



26
27
28
# File 'lib/hyll.rb', line 26

def self.deserialize(data)
  Factory.from_serialized(data)
end

.new(type: :standard, precision: 10) ⇒ HyperLogLog, EnhancedHyperLogLog

Shorthand method to create a new HyperLogLog counter

Parameters:

  • type (Symbol) (defaults to: :standard)

    the type of counter to create (:standard or :enhanced)

  • precision (Integer) (defaults to: 10)

    the precision to use

Returns:



19
20
21
# File 'lib/hyll.rb', line 19

def self.new(type: :standard, precision: 10)
  Factory.create(type: type, precision: precision)
end