Class: Evil::Metrics::Histogram

Inherits:
Metric
  • Object
show all
Defined in:
lib/evil/metrics/histogram.rb

Instance Attribute Summary collapse

Attributes inherited from Metric

#comment, #group, #name, #per, #unit

Instance Method Summary collapse

Methods inherited from Metric

#get, #values

Constructor Details

#initialize(name, **options) ⇒ Object

Parameters:

  • name

    Metric name. Use snake_case. E.g. job_runtime

  • options (Hash)

Options Hash (**options):

  • comment (Object) — default: nil

    Documentation string. Required by some adapters.

  • unit (Object) — default: nil

    In which units it is measured. E.g. ‘seconds`

  • per (Object) — default: nil

    Per which unit is measured ‘unit`. E.g. `call` as in seconds per call

  • group (Object) — default: nil

    Category name for grouping metrics

  • buckets (Object)

Instance Attribute Details

#bucketsObject (readonly)

Reader method for the buckets initializer parameter.



6
# File 'lib/evil/metrics/histogram.rb', line 6

option :buckets

Instance Method Details

#measure(tags, value) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/evil/metrics/histogram.rb', line 8

def measure(tags, value)
  values[tags] = value
  ::Evil::Metrics.adapters.each do |_, adapter|
    adapter.perform_histogram_measure!(self, tags, value)
  end
  value
end