Method: NewRelic::Agent::Stats#record

Defined in:
lib/new_relic/agent/stats.rb

#record(value = nil, aux = nil, &blk) ⇒ Object

[View source]

77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/new_relic/agent/stats.rb', line 77

def record(value = nil, aux = nil, &blk)
  if blk
    yield(self)
  else
    case value
    when Numeric
      aux ||= value
      self.record_data_point(value, aux)
    when :apdex_s, :apdex_t, :apdex_f
      self.record_apdex(value, aux)
    when NewRelic::Agent::Stats
      self.merge!(value)
    end
  end
end