Skip to content

Commit

Permalink
fix Desktop edition: it didn't work unless the user put a real licens…
Browse files Browse the repository at this point in the history
…e key in, and we want it to work without a license key.
  • Loading branch information
cirne committed Apr 23, 2008
1 parent 3622981 commit 3f6966c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
6 changes: 4 additions & 2 deletions install.rb
Expand Up @@ -6,7 +6,9 @@
src_config_file = "#{File.dirname(__FILE__)}/sample_config.yml"

unless File::exists? dest_config_file
puts "\nInstalling a default configuration file. Be sure to edit these settings to enable the NewRelic Agent.\n"
puts "See #{dest_config_file}"
File::copy src_config_file, dest_config_file, true
puts "\nInstalling a default configuration file."
puts "To monitor your application in production mode, you must enter a license key."
puts "See #{dest_config_file}"
puts "For a license key, sign up at http://rpm.newrelic.com/signup."
end
14 changes: 7 additions & 7 deletions lib/newrelic/agent/agent.rb
Expand Up @@ -106,13 +106,6 @@ def start(config)
@sample_threshold = (config['sample_threshold'] || 2).to_i
@license_key = config.fetch('license_key', nil)

# make sure the license key exists and is likely to be really a license key
# by checking it's string length (license keys are 40 character strings.)
unless @license_key && @license_key.length == 40
log! "No license key found. Please insert your license key into agent/newrelic.yml"
return
end

@use_ssl = config.fetch('ssl', false)
default_port = @use_ssl ? 443 : 80

Expand All @@ -123,6 +116,13 @@ def start(config)
instrument_rails

if config['enabled']
# make sure the license key exists and is likely to be really a license key
# by checking it's string length (license keys are 40 character strings.)
unless @license_key && @license_key.length == 40
log! "No license key found. Please insert your license key into agent/newrelic.yml"
return
end

load_samplers

@worker_thread = Thread.new do
Expand Down
8 changes: 7 additions & 1 deletion sample_config.yml
Expand Up @@ -42,9 +42,15 @@ development:
<<: *default_settings
# turn off in development.
# NOTE: for initial evaluation purposes, you may want to temporarily turn
# the agent on in developmen mode.
# the agent on in development mode.
enabled: false

# the desktop edition is turned on in development mode. The desktop edition
# will present performance information on the last 100 transactions you have
# executed since starting the mongrel. to view this data, go to
# http://localhost:3000/developer
developer: true

test:
<<: *default_settings
# it almost never makes sense to turn on the agent when running unit, functional or
Expand Down

0 comments on commit 3f6966c

Please sign in to comment.