Sha256: 8e4cd5ba413d3ddf5cef2022c0d8be56932f5396c5005cd3f97556e54afd4af5

Contents?: true

Size: 1.36 KB

Versions: 22

Compression:

Stored size: 1.36 KB

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.

# Primarily just tests allocations around argument formatting
class Redis < Performance::TestCase
  def test_no_args
    with_config(:'transaction_tracer.record_redis_arguments' => true) do
      command = ["lonely_command"]
      measure do
        NewRelic::Agent::Datastores::Redis.format_command(command)
      end
    end
  end

  def test_args
    with_config(:'transaction_tracer.record_redis_arguments' => true) do
      commands = ["argumentative", "commands", "get", "called", "a", "bunch"]
      measure do
        NewRelic::Agent::Datastores::Redis.format_command(commands)
      end
    end
  end

  def test_long_args
    with_config(:'transaction_tracer.record_redis_arguments' => true) do
      commands = ["loooooong_command", "a" * 100, "b" * 100, "c" * 100]
      measure do
        NewRelic::Agent::Datastores::Redis.format_command(commands)
      end
    end
  end

  def test_pipelined
    with_config(:'transaction_tracer.record_redis_arguments' => true) do
      pipeline = [
        ["first", "a" * 100, "b" * 100, "c" * 100],
        ["second", "a" * 100, "b" * 100, "c" * 100]]

      measure do
        NewRelic::Agent::Datastores::Redis.format_pipeline_commands(pipeline)
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
newrelic_rpm-4.1.0.333 test/performance/suites/redis.rb
newrelic_rpm-4.0.0.332 test/performance/suites/redis.rb
newrelic_rpm-3.18.1.330 test/performance/suites/redis.rb
newrelic_rpm-3.18.0.329 test/performance/suites/redis.rb
newrelic_rpm-3.17.2.327 test/performance/suites/redis.rb
newrelic_rpm-3.17.1.326 test/performance/suites/redis.rb
newrelic_rpm-3.17.0.325 test/performance/suites/redis.rb
newrelic_rpm-3.16.3.323 test/performance/suites/redis.rb
newrelic_rpm-3.16.2.321 test/performance/suites/redis.rb
newrelic_rpm-3.16.1.320 test/performance/suites/redis.rb
newrelic_rpm-3.16.0.318 test/performance/suites/redis.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.2.317/test/performance/suites/redis.rb
newrelic_rpm-3.15.2.317 test/performance/suites/redis.rb
newrelic_rpm-3.15.1.316 test/performance/suites/redis.rb
newrelic_rpm-3.15.0.314 test/performance/suites/redis.rb
newrelic_rpm-3.14.3.313 test/performance/suites/redis.rb
newrelic_rpm-3.14.2.312 test/performance/suites/redis.rb
newrelic_rpm-3.14.1.311 test/performance/suites/redis.rb
newrelic_rpm-3.14.0.305 test/performance/suites/redis.rb
newrelic_rpm-3.13.2.302 test/performance/suites/redis.rb