mirror of
https://github.com/discourse/discourse.git
synced 2025-03-25 19:45:34 +08:00
enable eager loading in profile mode
correct bench script
This commit is contained in:
parent
ad0bef5ef6
commit
9c6c0f2a3d
@ -1,6 +1,8 @@
|
||||
Discourse::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
|
||||
config.eager_load = true if rails4?
|
||||
|
||||
# Code is not reloaded between requests
|
||||
config.cache_classes = true
|
||||
|
||||
|
@ -93,13 +93,13 @@ puts "Populating Profile DB"
|
||||
run("bundle exec ruby script/profile_db_generator.rb")
|
||||
|
||||
puts "Getting api key"
|
||||
api_key = `bundle exec rake api_key:get`
|
||||
api_key = `bundle exec rake api_key:get`.split("\n")[-1]
|
||||
|
||||
def bench(path)
|
||||
puts "Running apache bench warmup"
|
||||
`ab -n 100 http://127.0.0.1:#{@port}#{path}`
|
||||
`ab -n 100 "http://127.0.0.1:#{@port}#{path}"`
|
||||
puts "Benchmarking #{path}"
|
||||
`ab -n 100 -e tmp/ab.csv http://127.0.0.1:#{@port}#{path}`
|
||||
`ab -n 100 -e tmp/ab.csv "http://127.0.0.1:#{@port}#{path}"`
|
||||
|
||||
percentiles = Hash[*[50, 75, 90, 99].zip([]).flatten]
|
||||
CSV.foreach("tmp/ab.csv") do |percent, time|
|
||||
@ -128,6 +128,7 @@ begin
|
||||
topic_page = bench("/t/oh-how-i-wish-i-could-shut-up-like-a-tunnel-for-so/69")
|
||||
|
||||
append = "?api_key=#{api_key}&api_username=admin1"
|
||||
|
||||
home_page_admin = bench("/#{append}")
|
||||
topic_page_admin = bench("/t/oh-how-i-wish-i-could-shut-up-like-a-tunnel-for-so/69#{append}")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user