Class: NewRelic::Control::Rails3

Inherits:
NewRelic::Control show all
Defined in:
lib/new_relic/control/rails3.rb

Overview

Control subclass instantiated when Rails is detected. Contains Rails specific configuration, instrumentation, environment values, etc.

Instance Attribute Summary

Attributes inherited from NewRelic::Control

#local_env, #log_file

Instance Method Summary collapse

Methods inherited from NewRelic::Control

#[], #[]=, #add_instrumentation, #agent_enabled?, #apdex_t, #api_server, #app, #app_names, #capture_params, #developer_mode?, #dispatcher, #dispatcher_instance_id, #fetch, format_message, #http_connection, #init_plugin, #install_instrumentation, instance, #license_key, #load_samplers, #log, #log!, #monitor_mode?, #multi_threaded?, #post_size_limit, #profiling=, #profiling?, #profiling_available?, #proxy_server, #server, #server_from_host, #settings, #start_agent, #sync_startup, #to_s, #use_ssl?, #use_textmate?, #validate_seed, #validate_token, #verify_certificate?

Instance Method Details

#envObject



6
7
8
# File 'lib/new_relic/control/rails3.rb', line 6

def env
  @env ||= ::Rails.env.to_s
end

#init_config(options = {}) ⇒ Object



39
40
41
42
43
44
45
46
47
48
# File 'lib/new_relic/control/rails3.rb', line 39

def init_config(options={})
  rails_config=options[:config]
  if !agent_enabled?
    # Might not be running if it does not think mongrel, thin, passenger, etc
    # is running, if it things it's a rake task, or if the agent_enabled is false.
    logger.info "New Relic Agent not running."
  else
    logger.info "Starting the New Relic Agent."
  end
end

#log_pathObject



27
28
29
# File 'lib/new_relic/control/rails3.rb', line 27

def log_path
  @log_path ||= File.expand_path(File.dirname(base_log_file))
end

#loggerObject



14
15
16
# File 'lib/new_relic/control/rails3.rb', line 14

def logger
  ::Rails.logger
end

#rootObject



10
11
12
# File 'lib/new_relic/control/rails3.rb', line 10

def root
  @root ||= Rails.root.to_s
end

#vendor_rootObject



31
32
33
# File 'lib/new_relic/control/rails3.rb', line 31

def vendor_root
  @vendor_root ||= File.join(root,'vendor','rails')
end

#versionObject



35
36
37
# File 'lib/new_relic/control/rails3.rb', line 35

def version
  @rails_version ||= NewRelic::VersionNumber.new(::Rails::VERSION::STRING)
end