Sha256: f0c6a496d494473b1879a6b03628ad643bc7ab2675fdbae6e18d468569f1507e

Contents?: true

Size: 1.32 KB

Versions: 50

Compression:

Stored size: 1.32 KB

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'rack'
require 'rack/handler/mongrel'
require 'optparse'

port = 3000
options = { }
appname = nil
OptionParser.new do |opts|
  opts.banner = "Usage: #{File.basename($0)} [options] [app_name]"
  opts.on("-p", "--port=port", Integer, "default: #{port}") { | port | }
  opts.on("--[no-]logging", "turn off request logging" ) { | l | options[:logging] = l }
  opts.on("--license=rpm_license_key", "override license key" ) { | l | options[:license_key] = l }
  opts.on("--install", "install a newrelic.yml template" ) { | l | options[:install] = true }
  opts.separator ""
  opts.separator "app_name is the name of the application where the metrics will be stored"
  opts.separator ""
  # The rackup file references this var
  appname = opts.parse!(ARGV.clone).first
end

options[:app_name] = appname if appname

ru_file = File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "new_relic", "rack", "mongrel_rpm.ru"))
rackup_code = File.read ru_file
builder = Rack::Builder.new { eval rackup_code, binding, ru_file }

options = { :Host => '127.0.0.1', :Port => port }
Rack::Handler::Mongrel.run(builder.to_app, options) do | server |
  NewRelic::Control.instance.log! "Started Mongrel listening for '#{NewRelic::Control.instance.app_names.join(" and ")}' data at #{server.host}:#{server.port}" 
end

Version data entries

50 entries across 50 versions & 4 rubygems

Version Path
newrelic_rpm-3.0.1 bin/mongrel_rpm
newrelic_rpm-3.1.0.beta1 bin/mongrel_rpm
newrelic_rpm-3.0.0 bin/mongrel_rpm
newrelic_rpm-3.0.0.beta2 bin/mongrel_rpm
newrelic_rpm-3.0.0.beta1 bin/mongrel_rpm
newrelic_rpm-2.14.1.logging1 bin/mongrel_rpm
newrelic_rpm-2.14.1 bin/mongrel_rpm
newrelic_rpm-2.13.4.rum6 bin/mongrel_rpm
newrelic_rpm-2.14.0 bin/mongrel_rpm
newrelic_rpm-2.13.4.rum5 bin/mongrel_rpm
newrelic_rpm-2.13.6.beta2 bin/mongrel_rpm
newrelic_rpm-2.13.6.beta1 bin/mongrel_rpm
newrelic_rpm-2.13.4.rum4 bin/mongrel_rpm
newrelic_rpm-2.13.5.beta4 bin/mongrel_rpm
newrelic_rpm-2.13.5.beta3 bin/mongrel_rpm
newrelic_rpm-2.13.5.beta2 bin/mongrel_rpm
newrelic_rpm-2.13.5.beta1 bin/mongrel_rpm
newrelic_rpm-2.13.4.eum3 bin/mongrel_rpm
newrelic_rpm-2.13.4.eum2 bin/mongrel_rpm
newrelic_rpm-2.13.4.eum1 bin/mongrel_rpm