Created
March 18, 2013 21:03
-
-
Save nickw/5190786 to your computer and use it in GitHub Desktop.
sinatra_new_relic_1.rb sets up New Relic in the config.ru
<br>
sinatra_new_relic_2.rb sets up New Relic in the Sinatra App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# server.rb | |
$: << File.expand_path(File.dirname(__FILE__) + "/../lib") | |
require "sinatra/base" | |
require "newrelic_rpm" | |
module CrowdHall | |
class Server < Sinatra::Base | |
configure do | |
set :app_file, __FILE__ | |
set :port, ENV["PORT"] | |
end | |
get "/" do | |
erb :index | |
end | |
run! if app_file == $0 | |
end | |
end | |
# config.ru | |
require 'newrelic_rpm' | |
require 'new_relic/rack/developer_mode' | |
use NewRelic::Rack::DeveloperMode | |
NewRelic::Agent.after_fork(:force_reconnect => true) | |
require "./server/server.rb" | |
run CrowdHall::Server | |
# Procfile | |
web: bundle exec rackup -s thin -p $PORT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# server.rb | |
$: << File.expand_path(File.dirname(__FILE__) + "/../lib") | |
require "sinatra/base" | |
require "newrelic_rpm" | |
module CrowdHall | |
class Server < Sinatra::Base | |
configure do | |
set :app_file, __FILE__ | |
set :port, ENV["PORT"] | |
end | |
configure :development do | |
require "new_relic/rack/developer_mode" | |
use NewRelic::Rack::DeveloperMode | |
end | |
NewRelic::Agent.after_fork(force_reconnect: true) | |
get "/" do | |
erb :index | |
end | |
run! if app_file == $0 | |
end | |
end | |
# config.ru | |
require "./server/server.rb" | |
run CrowdHall::Server | |
# Procfile | |
web: bundle exec rackup -s thin -p $PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment