Sha256: 0a5a5239aaad2558f81cbe1ed0e408a134a7647096e85a67d1397aee849990ce

Contents?: true

Size: 661 Bytes

Versions: 4

Compression:

Stored size: 661 Bytes

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

class StatsHashPerfTest < Performance::TestCase
  def setup
    @hash = NewRelic::Agent::StatsHash.new
  end

  def test_record
    measure do
      hash = NewRelic::Agent::StatsHash.new
      100.times do |i|
        hash.record("foo#{i}", 1)
      end
    end
  end

  def test_merge
    measure do
      incoming = {}
      100.times do |i|
        incoming["foo#{i}"] = NewRelic::Agent::Stats.new
      end

      hash = NewRelic::Agent::StatsHash.new
      hash.merge!(incoming)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
newrelic_rpm-3.12.0.288 test/performance/suites/stats_hash.rb
newrelic_rpm-3.11.2.286 test/performance/suites/stats_hash.rb
newrelic_rpm-3.11.1.284 test/performance/suites/stats_hash.rb
newrelic_rpm-3.11.0.283 test/performance/suites/stats_hash.rb