File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,11 +76,13 @@ def port_available? port
7676puts `bundle exec rake db:create`
7777`bundle exec rake db:migrate`
7878
79- puts "Loading Rails"
79+ puts "Timing loading Rails"
8080measure ( "load_rails" ) do
8181 `bundle exec rake middleware`
8282end
8383
84+ puts "Populating Profile DB"
85+ run ( "bundle exec ruby script/profile_db_generator.rb" )
8486
8587begin
8688 pid = spawn ( "bundle exec thin start -p #{ port } " )
Original file line number Diff line number Diff line change 11# can be used to generate a mock db for profiling purposes
22
3+ # we want our script to generate a consistent output, to do so
4+ # we monkey patch array sample so it always uses the same rng
5+ class Array
6+ RNG = Random . new ( 1098109928029800 )
7+
8+ def sample
9+ self [ RNG . rand ( size ) ]
10+ end
11+ end
12+
13+
314# based on https://gist.github.com/zaius/2643079
415def unbundled_require ( gem )
516 if defined? ( ::Bundler )
@@ -21,8 +32,9 @@ def unbundled_require(gem)
2132begin
2233 unbundled_require 'gabbler'
2334rescue LoadError
24- puts "please run: gem install gabller"
25- exit
35+ puts "installing gabbler gem"
36+ puts `gem install gabbler`
37+ unbundled_require 'gabbler'
2638end
2739
2840user_id = nil
You can’t perform that action at this time.
0 commit comments