mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FEATURE: add rss to bench
BUGFIX: profile db generator require ordering
This commit is contained in:
parent
9f2150faea
commit
90a7cb9dc3
2 changed files with 19 additions and 16 deletions
|
@ -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
|
||||
|
|
|
@ -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 "."
|
||||
|
|
Loading…
Reference in a new issue