Module: Honeycomb::RollupFields

Included in:
Span, Trace
Defined in:
lib/honeycomb/rollup_fields.rb

Overview

Functionality for including ‘rollup_fields’. Which are fields that can be tracked numerically and will also be propogated up to an existing trace.

Instance Method Summary collapse

Instance Method Details

#add_rollup_field(key, value) ⇒ Object



13
14
15
16
17
18
# File 'lib/honeycomb/rollup_fields.rb', line 13

def add_rollup_field(key, value)
  return unless value.is_a? Numeric

  respond_to?(:trace) && trace.add_rollup_field(key, value)
  rollup_fields[key] += value
end

#rollup_fieldsObject



9
10
11
# File 'lib/honeycomb/rollup_fields.rb', line 9

def rollup_fields
  @rollup_fields ||= Hash.new(0)
end