Sha256: 6ffe809c20c37ccbee39d6eefa4ace1f0f52e9b0483476bc694100c04954e9b5

Contents?: true

Size: 881 Bytes

Versions: 27

Compression:

Stored size: 881 Bytes

Contents

require 'statsd-instrument'
require 'benchmark/ips'

Benchmark.ips do |bench|
  bench.report("normalized tags with simple hash") do
    StatsD::Instrument::Metric.normalize_tags(:tag => 'value')
  end

  bench.report("normalized tags with simple array") do
    StatsD::Instrument::Metric.normalize_tags(['test:test'])
  end

  bench.report("normalized tags with large hash") do
    StatsD::Instrument::Metric.normalize_tags({
      mobile: true,
      pod: "1",
      protocol: "https",
      country: "Langbortistan",
      complete: true,
      shop: "omg shop that has a longer name",
    })
  end

  bench.report("normalized tags with large array") do
    StatsD::Instrument::Metric.normalize_tags([
      "mobile:true",
      "pod:1",
      "protocol:https",
      "country:Langbortistan",
      "complete:true",
      "shop:omg_shop_that_has_a_longer_name",
    ])
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
qubole-statsd-instrument-2.1.6 test/benchmark/tags.rb
statsd-instrument-2.3.5 test/benchmark/tags.rb
statsd-instrument-2.3.4 test/benchmark/tags.rb
qubole-statsd-instrument-2.1.5 test/benchmark/tags.rb
statsd-instrument-2.3.2 test/benchmark/tags.rb
statsd-instrument-2.3.1 test/benchmark/tags.rb
qubole-statsd-instrument-2.1.4 test/benchmark/tags.rb
statsd-instrument-2.3.0 test/benchmark/tags.rb
statsd-instrument-2.3.0.beta6 test/benchmark/tags.rb
statsd-instrument-2.3.0.beta5 test/benchmark/tags.rb
statsd-instrument-2.3.0.beta4 test/benchmark/tags.rb
statsd-instrument-2.3.0.beta3 test/benchmark/tags.rb
statsd-instrument-2.3.0.beta2 test/benchmark/tags.rb
statsd-instrument-2.3.0.beta test/benchmark/tags.rb
statsd-instrument-2.2.1 test/benchmark/tags.rb
statsd-instrument-2.2.0 test/benchmark/tags.rb
statsd-instrument-2.1.4 test/benchmark/tags.rb
statsd-instrument-2.1.3 test/benchmark/tags.rb
statsd-instrument-2.1.2 test/benchmark/tags.rb
statsd-instrument-2.1.1 test/benchmark/tags.rb