我想为我的rails 3应用程序进行性能测试,我根据rails在线指南进行了尝试
rake test:profile
Run Code Online (Sandbox Code Playgroud)
它给出了一些输出:
Specify ruby-prof as application's dependency in Gemfile to run benchmarks.
Loaded suite /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/rake_test_loader
Started
.
Finished in 0.326233 seconds.
1 tests, 0 assertions, 0 failures, 0 errors, 0 skips
Run Code Online (Sandbox Code Playgroud)
但根据指南,应该有类似的东西:
BrowsingTest#test_homepage (31 ms warmup)
wall_time: 6 ms
memory: 437.27 KB
objects: 5,514
gc_runs: 0
gc_time: 19 ms
Run Code Online (Sandbox Code Playgroud)
以及在app的tmp/performance dir中生成的一些日志文件,在我的情况下不存在.
性能测试是在我的应用程序的test\performance目录中生成的示例测试browse_test.rb:
require 'test_helper'
require 'rails/performance_test_help'
# Profiling results for each test method are written to tmp/performance.
class BrowsingTest < ActionDispatch::PerformanceTest
def test_homepage
get '/'
end
end …Run Code Online (Sandbox Code Playgroud) 我当地的时区是PRC(中国),UTC + 8,但是
select (timestamp '2016-09-01 00:00:00' at time zone 'PRC')
- (timestamp '2016-09-01 00:00:00' at time zone 'UTC');
Run Code Online (Sandbox Code Playgroud)
回报-08:00:00.不应该+08:00:00吗?
我的PostgreSQL版本是9.5.