Module: Influxer::Calculations

Included in:
Relation
Defined in:
lib/influxer/metrics/relation/calculations.rb

Overview

:nodoc:

Constant Summary collapse

CALCULATION_METHODS =
[
  :count, :min, :max, :mean,
  :mode, :median, :distinct, :derivative,
  :stddev, :sum, :first, :last
].freeze

Instance Method Summary collapse

Instance Method Details

#percentile(name, val, alias_name = nil) ⇒ Object



22
23
24
25
26
# File 'lib/influxer/metrics/relation/calculations.rb', line 22

def percentile(name, val, alias_name = nil)
  @values[:has_calculations] = true
  select_values << "percentile(#{name}, #{val})#{alias_name ? ' as ' + alias_name.to_s : ''}"
  self
end