Method: NewRelic::Agent::StatsHash#merge!

Defined in:
lib/new_relic/agent/stats_engine/stats_hash.rb

#merge!(other) ⇒ Object

[View source]

135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/new_relic/agent/stats_engine/stats_hash.rb', line 135

def merge!(other)
  @started_at = other.started_at if other.started_at < @started_at

  other.each do |spec, val|
    if spec.scope.empty?
      merge_or_insert(@unscoped, spec.name, val)
    else
      merge_or_insert(@scoped, spec, val)
    end
  end
  self
end