lib/new_relic/agent/stats.rb in newrelic_rpm-8.2.0 vs lib/new_relic/agent/stats.rb in newrelic_rpm-8.3.0

- old
+ new

@@ -34,33 +34,33 @@ end def merge!(other) @min_call_time = other.min_call_time if min_time_less?(other) @max_call_time = other.max_call_time if other.max_call_time > max_call_time - @total_call_time += other.total_call_time + @total_call_time += other.total_call_time @total_exclusive_time += other.total_exclusive_time - @sum_of_squares += other.sum_of_squares + @sum_of_squares += other.sum_of_squares @call_count += other.call_count self end def to_s "[#{'%2i' % call_count.to_i} calls #{'%.4f' % total_call_time.to_f}s / #{'%.4f' % total_exclusive_time.to_f}s ex]" end def to_json(*_) { - 'call_count' => call_count.to_i, - 'min_call_time' => min_call_time.to_f, - 'max_call_time' => max_call_time.to_f, - 'total_call_time' => total_call_time.to_f, + 'call_count' => call_count.to_i, + 'min_call_time' => min_call_time.to_f, + 'max_call_time' => max_call_time.to_f, + 'total_call_time' => total_call_time.to_f, 'total_exclusive_time' => total_exclusive_time.to_f, - 'sum_of_squares' => sum_of_squares.to_f + 'sum_of_squares' => sum_of_squares.to_f }.to_json(*_) end - def record(value=nil, aux=nil, &blk) + def record(value = nil, aux = nil, &blk) if blk yield self else case value when Numeric @@ -104,17 +104,17 @@ "#<NewRelic::Agent::Stats #{variables}>" end def ==(other) other.class == self.class && - ( - @min_call_time == other.min_call_time && - @max_call_time == other.max_call_time && - @total_call_time == other.total_call_time && - @total_exclusive_time == other.total_exclusive_time && - @sum_of_squares == other.sum_of_squares && - @call_count == other.call_count - ) + ( + @min_call_time == other.min_call_time && + @max_call_time == other.max_call_time && + @total_call_time == other.total_call_time && + @total_exclusive_time == other.total_exclusive_time && + @sum_of_squares == other.sum_of_squares && + @call_count == other.call_count + ) end # Apdex-related accessors alias_method :apdex_s, :call_count alias_method :apdex_t, :total_call_time