Sha256: c15d6645c20f172e960cb0eaa8882e2d9ec31872786ae9a067285417f3dc8947

Contents?: true

Size: 907 Bytes

Versions: 34

Compression:

Stored size: 907 Bytes

Contents

# frozen_string_literal: true

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

34 entries across 34 versions & 1 rubygems

Version Path
statsd-instrument-3.9.9 test/benchmark/tags.rb
statsd-instrument-3.9.8 test/benchmark/tags.rb
statsd-instrument-3.9.7 test/benchmark/tags.rb
statsd-instrument-3.9.6 test/benchmark/tags.rb
statsd-instrument-3.9.5 test/benchmark/tags.rb
statsd-instrument-3.9.4 test/benchmark/tags.rb
statsd-instrument-3.9.3 test/benchmark/tags.rb
statsd-instrument-3.9.2 test/benchmark/tags.rb
statsd-instrument-3.9.1 test/benchmark/tags.rb
statsd-instrument-3.9.0 test/benchmark/tags.rb
statsd-instrument-3.8.0 test/benchmark/tags.rb
statsd-instrument-3.7.0 test/benchmark/tags.rb
statsd-instrument-3.6.1 test/benchmark/tags.rb
statsd-instrument-3.6.0 test/benchmark/tags.rb
statsd-instrument-3.5.12 test/benchmark/tags.rb
statsd-instrument-3.5.11 test/benchmark/tags.rb
statsd-instrument-3.5.10 test/benchmark/tags.rb
statsd-instrument-3.5.9 test/benchmark/tags.rb
statsd-instrument-3.5.8 test/benchmark/tags.rb
statsd-instrument-3.5.7 test/benchmark/tags.rb