diff --git a/script/bench.rb b/script/bench.rb index dae96933d61..9a402d5b737 100644 --- a/script/bench.rb +++ b/script/bench.rb @@ -174,13 +174,16 @@ begin run("RAILS_ENV=profile bundle exec rake assets:clean") + rss = `ps -o rss -p #{pid}`.chomp.split("\n").last.to_i + results = { "home_page" => home_page, "topic_page" => topic_page, "home_page_admin" => home_page_admin, "topic_page_admin" => topic_page_admin, "timings" => @timings, - "ruby-version" => "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" + "ruby-version" => "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}", + "rss_kb" => rss }.merge(facts).to_yaml puts results diff --git a/script/profile_db_generator.rb b/script/profile_db_generator.rb index 244b18c829e..0a53fc09af2 100644 --- a/script/profile_db_generator.rb +++ b/script/profile_db_generator.rb @@ -28,21 +28,6 @@ def unbundled_require(gem) end end -# by default, Discourse has a "system" account -if User.count > 1 - puts "Only run this script against an empty DB" - exit -end - -require 'optparse' -begin - unbundled_require 'gabbler' -rescue LoadError - puts "installing gabbler gem" - puts `gem install gabbler` - unbundled_require 'gabbler' -end - def sentence @gabbler ||= Gabbler.new.tap do |gabbler| story = File.read(File.dirname(__FILE__) + "/alice.txt") @@ -76,6 +61,21 @@ unless Rails.env == "profile" exit end +# by default, Discourse has a "system" account +if User.count > 1 + puts "Only run this script against an empty DB" + exit +end + +require 'optparse' +begin + unbundled_require 'gabbler' +rescue LoadError + puts "installing gabbler gem" + puts `gem install gabbler` + unbundled_require 'gabbler' +end + puts "Creating 100 users" users = 100.times.map do |i| putc "."