Sha256: eee8a7c70dfb3eb5192fb11bff126d1f5c76a391ec63da7b8a9d2914341c17bb

Contents?: true

Size: 796 Bytes

Versions: 12

Compression:

Stored size: 796 Bytes

Contents

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

def helperFunction()
    a = 10
    a += a
    a -= a
    a *= a
end

Benchmark.ips do |bench|
  bench.report("increment metric benchmark") do
    StatsD.increment('GoogleBase.insert', 10)
  end

  bench.report("measure metric benchmark") do
    StatsD.measure('helperFunction') do
        helperFunction()
    end
  end

  bench.report("gauge metric benchmark") do
    StatsD.gauge('GoogleBase.insert', 12)
  end

  bench.report("set metric benchmark") do
    StatsD.set('GoogleBase.customers', "12345", sample_rate: 1.0)
  end

  bench.report("event metric benchmark") do
    StatsD.event('Event Title', "12345")
  end

  bench.report("service check metric benchmark") do
    StatsD.service_check('shipit.redis_connection', 'ok')
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
statsd-instrument-2.3.5 test/benchmark/metrics.rb
statsd-instrument-2.3.4 test/benchmark/metrics.rb
statsd-instrument-2.3.2 test/benchmark/metrics.rb
statsd-instrument-2.3.1 test/benchmark/metrics.rb
statsd-instrument-2.3.0 test/benchmark/metrics.rb
statsd-instrument-2.3.0.beta6 test/benchmark/metrics.rb
statsd-instrument-2.3.0.beta5 test/benchmark/metrics.rb
statsd-instrument-2.3.0.beta4 test/benchmark/metrics.rb
statsd-instrument-2.3.0.beta3 test/benchmark/metrics.rb
statsd-instrument-2.3.0.beta2 test/benchmark/metrics.rb
statsd-instrument-2.3.0.beta test/benchmark/metrics.rb
statsd-instrument-2.2.1 test/benchmark/metrics.rb