Class: NewRelic::Control::Merb

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

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, #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, #to_s, #use_ssl?, #use_textmate?, #verify_certificate?

Instance Method Details

#envObject



3
4
5
# File 'lib/new_relic/control/merb.rb', line 3

def env
  @env ||= ::Merb.env
end

#init_config(options = {}) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/new_relic/control/merb.rb', line 16

def init_config options={}
  ::Merb::Plugins.add_rakefiles File.join(newrelic_root,"lib/tasks/all.rb")
  
  # Merb gives you a Merb::Plugins.config hash...feel free to put your stuff in your piece of it
  ::Merb::Plugins.config[:newrelic] = {
    :config => self
  }
end

#rootObject



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

def root 
  ::Merb.root
end

#to_stdout(msg) ⇒ Object



10
11
12
13
14
# File 'lib/new_relic/control/merb.rb', line 10

def to_stdout(msg)
  Merb.logger.info("NewRelic ~ " + msg)
rescue Exception => e
  STDOUT.puts "NewRelic ~ " + msg 
end