lib/new_relic/agent/stats.rb in newrelic_rpm-3.6.4.122 vs lib/new_relic/agent/stats.rb in newrelic_rpm-3.6.5.130
- old
+ new
@@ -115,19 +115,21 @@
# Apdex-related accessors
alias_method :apdex_s, :call_count
alias_method :apdex_t, :total_call_time
alias_method :apdex_f, :total_exclusive_time
- def record_apdex_s
- @call_count += 1
- end
-
- def record_apdex_t
- @total_call_time += 1
- end
-
- def record_apdex_f
- @total_exclusive_time += 1
+ def record_apdex(bucket, apdex_t)
+ case bucket
+ when :apdex_s then @call_count += 1
+ when :apdex_t then @total_call_time += 1
+ when :apdex_f then @total_exclusive_time += 1
+ end
+ if apdex_t
+ @min_call_time = apdex_t
+ @max_call_time = apdex_t
+ else
+ ::NewRelic::Agent.logger.warn("Attempted to set apdex_t to #{apdex_t.inspect}, backtrace = #{caller.join("\n")}")
+ end
end
protected
def min_time_less?(other)