새로운 유물 설명서를 말한다 : To prevent page load timing (sometimes referred to as real user monitoring or RUM) for all actions in a controller, add a call like this to the controller class: newrelic_ignore_enduser
정의되지 않은 지역 변수 또는 메소드`newrelic_ignore_enduser '
내가 다음과 같이 newrelic_ignore_enduser
에 전화를 추가하고 오류 undefined local variable or method 'newrelic_ignore_enduser'
을 얻었다.
books_controller.rb
class BooksController < ApplicationController
require 'newrelic_rpm'
...
def show
newrelic_ignore_enduser
end
...
end
Gemfile
gem 'newrelic_rpm', '~> 3.9.9.275'
질문 :이 전화를 할 수 있도록 내가 위해 (? require
뭔가 아마도) 어떻게해야합니까 무엇 방법?
업데이트
아차! 나는 이전에 만 Gemfile
에 production
그룹에 포함 시켰습니다. 나는 이것을 group :development, :production do
에 추가했는데 도움이되었습니다. 두 번째로해야 할 일은 newrelic_ignore_enduser only: :show
이라는 메서드를 class
레벨 (선택한 답변에 표시된 것과 같음)로 호출하는 것이지, 처음 시도한 작업 내에서는 호출하지 않습니다. 이상적으로는 액션 내에서이 메소드를 호출하고 조건을 기반으로하는 것이 좋습니다. 있는지 확인 당신이`NoMethodError`을받을 경우 레일 컨트롤러 또는시나 응용 프로그램 내에서`newrelic_ignore`를 사용하려고 할 때 :
을 다음과 같이
newrelic_ignore_enduser
를 사용한다고 생각합니다 클래스 정의 안에서'newrelic_ignore'를 호출하기 전에'newrelic_rpm'이 필요합니다. – ptd감사합니다. 나는'newrelic_rpm '을 요구했지만 불행히도 도움이되지 못했다. – user664833
실제로, 그것은 도움이되었습니다 - 나는 단지 그 대답과 의견을 결합하여 @aguardientico에 의해 덧붙여 야했습니다. 다시 한 번 감사드립니다! – user664833