Ruby on rails ruby教授的负时间?
我正在使用基于ruby prof的rspec prof评测一个需要花费相当长时间的规范。然而,我无法解释我得到的结果,因为他们报告的是负时间。我是否错误地使用了rspec prof/ruby prof?这是虫子吗Ruby on rails ruby教授的负时间?,ruby-on-rails,rspec,ruby-prof,Ruby On Rails,Rspec,Ruby Prof,我正在使用基于ruby prof的rspec prof评测一个需要花费相当长时间的规范。然而,我无法解释我得到的结果,因为他们报告的是负时间。我是否错误地使用了rspec prof/ruby prof?这是虫子吗 zkhan@ubuntu:~/rails_projects/gamestory_app$ rspec spec/controllers/games_controller_spec.rb Rack::File headers parameter replaces cache_contro
zkhan@ubuntu:~/rails_projects/gamestory_app$ rspec spec/controllers/games_controller_spec.rb
Rack::File headers parameter replaces cache_control after Rack 1.5.
.#<RSpec::Core::Example:0xad11370>
Thread ID: 75909140
Total: -0.650803
Sort by: self_time
%self total self wait child calls name
166.30 -6.402 -1.082 0.000 -5.320 212670 ActiveRecord::AttributeMethods::Dirty#write_attribute
335.29 -0.278 -2.182 0.000 1.904 425424 ActiveRecord::AttributeMethods#column_for_attribute
506.56 1.807 -3.297 0.000 5.103 170406 ActiveRecord::AttributeMethods#clone_attribute_value
517.51 -1.086 -3.368 0.000 2.282 51106 *Hash#each
580.84 -3.780 -3.780 0.000 0.000 79648 String#=~
597.22 -3.559 -3.887 0.000 0.327 114325 ActiveRecord::AttributeMethods#has_attribute?
600.60 -3.909 -3.909 0.000 0.000 162452 Thread#[]
601.95 -3.249 -3.917 0.000 0.669 46380 ActiveRecord::AttributeMethods#respond_to?
607.83 -1.781 -3.956 0.000 2.175 76529 *Array#map
627.42 -3.986 -4.083 0.000 0.097 93932 Fixnum#==
629.84 1.281 -4.099 0.000 5.380 69849 <Class::ActiveRecord::Base>#connection
641.72 -3.727 -4.176 0.000 0.449 8193 Logger::Formatter#call
645.68 -3.893 -4.202 0.000 0.309 16428 <Class::Time>#time_with_datetime_fallback
650.89 -4.229 -4.236 0.000 0.007 3486 <Class::Time>#_load_without_zone
653.77 -4.223 -4.255 0.000 0.032 7122 ActiveSupport::TimeWithZone#respond_to?
654.19 -4.116 -4.257 0.000 0.142 9510 EnumeratedAttribute::Attribute::AttributeDescriptor#allows_value?
1236.59 -4.752 -8.048 0.000 3.296 58802 ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#quote
2894.34 -18.465 -18.836 0.000 0.372 21840 BigDecimal#==
* indicates recursively called methods
.
Finished in 2 minutes 24.62 seconds
2 examples, 0 failures
Randomized with seed 63912
zkhan@ubuntu:~/rails\u projects/gamestory\u app$rspec spec/controllers/games\u controller\u spec.rb
Rack::File headers参数取代Rack 1.5之后的cache_控件。
.#
螺纹ID:75909140
总计:-0.650803
排序方式:自整时间
%self-total self-wait子调用名称
166.30-6.402-1.0820.000-5.320 212670 ActiveRecord::AttributeMethods::Dirty#write_属性
335.29-0.278-2.182 0.000 1.904 425424 ActiveRecord::AttributeMethods#列_表示_属性
506.56 1.807-3.297 0.000 5.103 170406 ActiveRecord::AttributeMethods#clone(克隆)属性(值)
517.51-1.086-3.368 0.000 2.282 51106*散列
580.84-3.780-3.780 0.000 0.000 79648字符串#=~
597.22-3.559-3.887 0.000 0.327 114325 ActiveRecord::AttributeMethods#has#u属性?
600.60-3.909-3.909 0.000 0.000 162452螺纹
601.95-3.249-3.917 0.000 0.669 46380 ActiveRecord::AttributeMethods#响应#?
607.83-1.781-3.956 0.000 2.175 76529*阵列图
627.42-3.986-4.083 0.000 0.097 93932 Fixnum#=
629.84 1.281-4.099 0.000 5.380 69849#连接
641.72-3.727-4.176 0.000 0.449 8193记录器::格式化程序#调用
645.68-3.893-4.202 0.000 0.309 16428带有日期时间回退的时间
650.89-4.229-4.236 0.000 0.007 3486无区域载荷
653.77-4.223-4.255 0.000 0.032 7122活动支持::TimeWithZone#响应?
654.19-4.116-4.257 0.000 0.142 9510 EnumeratedAttribute::Attribute::AttributeDescriptor#允许#U值?
1236.59-4.752-8.048 0.000 3.296 58802 ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#quote
2894.34-18.465-18.836 0.000 0.372 21840大十进制
*指示递归调用的方法
.
以2分24秒62的成绩完成
2个示例,0个失败
随机化种子63912
这确实是ruby-prof中的一个bug。我将这个问题发布到了他们的GitHub站点,据说即将发布一个修复版本
你使用timecop gem吗?不,我不使用。我在另一个问题中看到了这一点,但在我的文件中没有提到Timecop。