Sha256: 1d5af4b33a4ae3a425993e0c8213cda54a2f82056fbb76ecc066536422334c10

Contents?: true

Size: 1.57 KB

Versions: 25

Compression:

Stored size: 1.57 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_helper'))

class NewRelic::Agent::Instrumentation::MetricFrameTest < Test::Unit::TestCase

  attr_reader :f
  def setup
    @f = NewRelic::Agent::Instrumentation::MetricFrame.new
  end

  def test_request_parsing__none
    assert_nil f.uri
    assert_nil f.referer
  end
  def test_request_parsing__path
    request = stub(:path => '/path?hello=bob#none')
    f.request = request
    assert_equal "/path", f.uri
  end
  def test_request_parsing__fullpath
    request = stub(:fullpath => '/path?hello=bob#none')
    f.request = request
    assert_equal "/path", f.uri
  end
  def test_request_parsing__referer
    request = stub(:referer => 'https://www.yahoo.com:8080/path/hello?bob=none&foo=bar')
    f.request = request
    assert_nil f.uri
    assert_equal "https://www.yahoo.com:8080/path/hello", f.referer
  end

  def test_request_parsing__uri
    request = stub(:uri => 'http://creature.com/path?hello=bob#none', :referer => '/path/hello?bob=none&foo=bar')
    f.request = request
    assert_equal "/path", f.uri
    assert_equal "/path/hello", f.referer
  end

  def test_request_parsing__hostname_only
    request = stub(:uri => 'http://creature.com')
    f.request = request
    assert_equal "/", f.uri
    assert_nil f.referer
  end
  def test_request_parsing__slash
    request = stub(:uri => 'http://creature.com/')
    f.request = request
    assert_equal "/", f.uri
    assert_nil f.referer
  end

  def test_queue_time
    f.apdex_start = 1000
    f.start = 1500
    assert_equal 500, f.queue_time
  end
end

Version data entries

25 entries across 25 versions & 3 rubygems

Version Path
newrelic_rpm-3.5.7.59 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.7.59.beta test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.7.58.beta test/new_relic/agent/instrumentation/metric_frame_test.rb
wd_newrelic_rpm-3.5.6 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.7.57.beta test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.6.55 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.6.48.beta test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.6.46.beta test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.6.42.beta test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.5.39.beta test/new_relic/agent/instrumentation/metric_frame_test.rb
wd_newrelic_rpm-3.5.5 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.5.38 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.5.540.dev test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.4.35.beta test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.4.34 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.4.33 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.4.31.beta test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.4.29.beta test/new_relic/agent/instrumentation/metric_frame_test.rb
ghazel-newrelic_rpm-3.5.4 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.3.25 test/new_relic/agent/instrumentation/metric_frame_test.rb