Skip to content

Commit

Permalink
Remove unused Agent::ChainedStats class
Browse files Browse the repository at this point in the history
  • Loading branch information
kwugirl committed Feb 23, 2017
1 parent c5d8183 commit 9c9cbf6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
14 changes: 0 additions & 14 deletions lib/new_relic/agent/stats.rb
Expand Up @@ -141,19 +141,5 @@ def min_time_less?(other)
(other.min_call_time < min_call_time && other.call_count > 0) || call_count == 0
end
end

class ChainedStats
attr_accessor :scoped_stats, :unscoped_stats

def initialize(scoped_stats, unscoped_stats)
@scoped_stats = scoped_stats
@unscoped_stats = unscoped_stats
end

def method_missing(method, *args)
unscoped_stats.send(method, *args)
scoped_stats.send(method, *args)
end
end
end
end
20 changes: 0 additions & 20 deletions test/new_relic/agent/stats_test.rb
Expand Up @@ -148,26 +148,6 @@ def test_sum_of_squares_merge
assert_equal(s3.sum_of_squares, 4*4 + 7*7 + 13*13 + 16*16, "check sum of squares")
end

def test_chained_stats_proxies_calls_to_scoped_and_unscoped
scoped_stats = NewRelic::Agent::Stats.new
unscoped_stats = NewRelic::Agent::Stats.new
chained_stats = NewRelic::Agent::ChainedStats.new(scoped_stats, unscoped_stats)
chained_stats.record_data_point(42)
assert_equal(1, scoped_stats.call_count)
assert_equal(1, unscoped_stats.call_count)
assert_equal(42, scoped_stats.total_call_time)
assert_equal(42, unscoped_stats.total_call_time)
end

def test_chained_stats_returns_values_from_scoped
scoped_stats = NewRelic::Agent::Stats.new
unscoped_stats = NewRelic::Agent::Stats.new
chained_stats = NewRelic::Agent::ChainedStats.new(scoped_stats, unscoped_stats)
scoped_stats.record_data_point(42)
assert_equal(1, chained_stats.call_count)
assert_equal(42, chained_stats.total_call_time)
end

def test_to_json_enforces_float_values
s1 = NewRelic::Agent::Stats.new
s1.trace_call 3.to_r
Expand Down

0 comments on commit 9c9cbf6

Please sign in to comment.