Skip to content

Instantly share code, notes, and snippets.

View brynary's full-sized avatar

Bryan Helmkamp brynary

View GitHub Profile
Warbler.framework_detection = false
Warbler::Config.new do |config|
# Files to be included in the webapp.
config.dirs = %w[app lib config vendor/gems/dirs vendor/gems/gems vendor/gems/specifications]
config.includes << "vendor/gems/environment.rb"
config.webxml.booter = :rack
config.webxml.rackup = File.read("config.ru")
config.webxml.jruby.max.runtimes = 1 # Run threadsafe! ;-D
>> require "rubygems"
=> true
>> require "spec"
=> true
>> require "webrat"
=> true
>> $LOAD_PATH.grep /webrat/
=> ["/Users/bhelmkamp/.rvm/gems/ree/1.8.7/gems/webrat-0.6.rc1/bin", "/Users/bhelmkamp/.rvm/gems/ree/1.8.7/gems/webrat-0.6.rc1/lib"]
>> require "webrat/integrations/rspec-rails"
=> true
[11:06:16] $ /opt/ruby-1.9.2.pre/bin/gem bundle -V
The :vendored_at option is deprecated. Use :path instead.
From /Users/bhelmkamp/p/active/rails/Gemfile:4:in `evaluate'
The :vendored_at option is deprecated. Use :path instead.
From /Users/bhelmkamp/p/active/rails/Gemfile:13:in `block in evaluate'
The :vendored_at option is deprecated. Use :path instead.
From /Users/bhelmkamp/p/active/rails/Gemfile:13:in `block in evaluate'
The :vendored_at option is deprecated. Use :path instead.
From /Users/bhelmkamp/p/active/rails/Gemfile:13:in `block in evaluate'
The :vendored_at option is deprecated. Use :path instead.
# Write assets to public/assets/XX/YYYYYYYY/filename.ext
assets_path "assets"
# When including files, look in these directories
load_path << "app/stylesheets"
load_path << "public/stylesheets"
# Declare a CSS asset to be bundled
css_asset "content" do
include "typography"
Overhead with transaction traces enabled: 18%
Overhead without transaction traces enabled: 7%
Overhead with transaction traces enabled: 20%
Overhead without transaction traces enabled: 14%
[bhelmkamp@brynary] ~/p/vendor/memcached (master)
[11:59:43] $ sudo rake install
(in /Users/bhelmkamp/p/vendor/memcached)
Cleaning
- pkg
rm -rf pkg
Gemspec generated
mkdir -p pkg
mkdir -p pkg/memcached-0.16
rm -f pkg/memcached-0.16/BENCHMARKS
NewRelic w/o transactions:
$ ab -n 3000 -c 4 http://staging.weplay.com/users/LebronJames
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking staging.weplay.com (be patient)
Server Software: nginx
module AutoloadMethod
def autoload_method(method_name, filename)
self.instance_eval <<-SRC
def #{method_name}(*args, &block)
require #{filename.inspect}
#{method_name}(*args, &block)
end
SRC
end
end
class AdFrame < Rails::Rack::Metal
def self.call(env)
refresher = AdFrameApp.new
refresher.call(env)
end
end
class AdFrameApp
def call(env)
if env["REQUEST_URI"] =~ %r|^/ads/iframe/(.+)$|