Skip to content

Commit

Permalink
FEATURE: add rss to bench
Browse files Browse the repository at this point in the history
BUGFIX: profile db generator require ordering
  • Loading branch information
SamSaffron committed Jan 3, 2014
1 parent 9f2150f commit 90a7cb9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
5 changes: 4 additions & 1 deletion script/bench.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,16 @@ def bench(path)

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
Expand Down
30 changes: 15 additions & 15 deletions script/profile_db_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -76,6 +61,21 @@ def create_admin(seq)
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 "."
Expand Down

0 comments on commit 90a7cb9

Please sign in to comment.