回答
这似乎是一个全面的列表
http://edgeguides.rubyonrails.org/active_support_instrumentation.html#render_partial- ACTION_VIEW
配置/初始化/ notifications.rb
ActiveSupport::Notifications.subscribe "process_action.action_controller" do |name, start, finish, id, payload|
PageRequest.create! do |page_request|
page_request.path = payload[:path]
page_request.page_duration = (finish - start) * 1000
page_request.view_duration = payload[:view_runtime]
page_request.db_duration = payload[:db_runtime]
end
end
更多信息here
但是,当使用字符串或正则表达式有只是几个例子,我想问的是有可用的通知的完整列表 – 2012-04-02 10:50:55
@说,你能告诉一些关于http://stackoverflow.com/questions/146650 16/rails-activesupport-notifications-wrong-db-runtime-value? – Fivell 2013-02-05 16:59:49
我一直在寻找同样的事情。看起来没有关于此的文档,所以我浏览了代码并编译了以下列表。
注意,===
运算符用于匹配,这样你就可以订阅
receive.action_mailer
deliver.action_mailer
write_fragment.action_controller
read_fragment.action_controller
exist_fragment?.action_controller
expire_fragment.action_controller
expire_page.action_controller
write_page.action_controller
start_processing.action_controller
process_action.action_controller
send_file.action_controller
send_data.action_controller
redirect_to.action_controller
halted_callback.action_controller
render_collection.action_view
render_partial.action_view
render_template.action_view
!render_template.action_view
sql.active_record
cache_read.active_support
cache_fetch_hit.active_support
cache_generate.active_support
cache_write.active_support
cache_delete.active_support
cache_exist?.active_support
deprecation.rails
render
感谢这个 – 2012-04-21 18:54:39
非常感谢你:)这就是它! – 2012-05-09 10:24:52