Class: LogfileInterval::Aggregator::Pxx

Inherits:
Base
  • Object
show all
Defined in:
lib/vpsb_client/datafiles/pxx_aggregator.rb

Direct Known Subclasses

OneHundredMinusPxx

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Pxx

Returns a new instance of Pxx.



4
5
6
7
# File 'lib/vpsb_client/datafiles/pxx_aggregator.rb', line 4

def initialize(options)
  super
  @val = PxxBuckets.new(options)
end

Instance Method Details

#add(value, group_by = nil) ⇒ Object

Raises:

  • (NotImplementedError)


9
10
11
12
# File 'lib/vpsb_client/datafiles/pxx_aggregator.rb', line 9

def add(value, group_by = nil)
  raise NotImplementedError if group_by
  @val.increment(value)
end

#single_value?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/vpsb_client/datafiles/pxx_aggregator.rb', line 18

def single_value?
  false
end

#value(group) ⇒ Object



14
15
16
# File 'lib/vpsb_client/datafiles/pxx_aggregator.rb', line 14

def value(group)
  @val.value(group.to_f / 100.0)
end