Sha256: 881fe9cb593dfc0c36274f34fb9f5fd65ef50111ac65adcc057445323e0ee0cd

Contents?: true

Size: 1.17 KB

Versions: 5

Compression:

Stored size: 1.17 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.

# https://newrelic.atlassian.net/browse/RUBY-927

require 'rails/test_help'
require './app'
require 'multiverse_helpers'

class IgnoredController < ApplicationController
  include Rails.application.routes.url_helpers

  newrelic_ignore :only => :action_to_ignore
  newrelic_ignore_apdex :only => :action_to_ignore_apdex

  def action_to_ignore
    render :text => "Ignore this"
  end

  def action_to_ignore_apdex
    render :text => "This too"
  end
end

class IgnoredActionsTest < ActionDispatch::IntegrationTest

  include MultiverseHelpers

  setup_and_teardown_agent

  def after_setup
    # Make sure we've got a blank slate for doing easier metric comparisons
    NewRelic::Agent.instance.drop_buffered_data
  end

  def test_metric__ignore
    get 'ignored/action_to_ignore'
    assert_metrics_recorded_exclusive([])
  end

  def test_metric__ignore_apdex
    get 'ignored/action_to_ignore_apdex'
    assert_metrics_recorded(["Controller/ignored/action_to_ignore_apdex"])
    assert_metrics_not_recorded(["Apdex"])
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
newrelic_rpm-3.7.2.190.beta test/multiverse/suites/rails/ignore_test.rb
newrelic_rpm-3.7.1.188 test/multiverse/suites/rails/ignore_test.rb
newrelic_rpm-3.7.1.182 test/multiverse/suites/rails/ignore_test.rb
newrelic_rpm-3.7.1.180 test/multiverse/suites/rails/ignore_test.rb
newrelic_rpm-3.7.0.177 test/multiverse/suites/rails/ignore_test.rb