Class: NewRelic::Control::Ruby
Overview
A control used when no framework is detected. Looks for a newrelic.yml file in several locations including ./, ./config, $HOME/.newrelic and $HOME/. It loads the settings from the newrelic.yml section based on the value of RUBY_ENV or RAILS_ENV.
Instance Attribute Summary
#local_env, #log_file
Instance Method Summary
collapse
#[], #[]=, #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, #install_shim, 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
#config_file ⇒ Object
Check a sequence of file locations for newrelic.yml
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/new_relic/control/ruby.rb', line 15
def config_file
files = []
files << File.join(root,"config","newrelic.yml")
files << File.join(root,"newrelic.yml")
if ENV["HOME"]
files << File.join(ENV["HOME"], ".newrelic", "newrelic.yml")
files << File.join(ENV["HOME"], "newrelic.yml")
end
files << File.expand_path(ENV["NRCONFIG"]) if ENV["NRCONFIG"]
files.each do | file |
return File.expand_path(file) if File.exists? file
end
return File.expand_path(files.first)
end
|
#env ⇒ Object
8
9
10
|
# File 'lib/new_relic/control/ruby.rb', line 8
def env
@env ||= ENV['RUBY_ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
end
|
#init_config(options = {}) ⇒ Object
33
34
|
# File 'lib/new_relic/control/ruby.rb', line 33
def init_config(options={})
end
|
#root ⇒ Object
11
12
13
|
# File 'lib/new_relic/control/ruby.rb', line 11
def root
@root ||= ENV['APP_ROOT'] || Dir['.']
end
|
#to_stdout(msg) ⇒ Object
29
30
31
|
# File 'lib/new_relic/control/ruby.rb', line 29
def to_stdout(msg)
STDOUT.puts msg
end
|