请求Rails的Stats打印机

时间:2012-06-07 13:50:49

标签: ruby-on-rails logging profiling rack middleware

对于每个请求,rails默认记录在views / active_record(sql),活动资源http请求等中花费的时间。例如,

Started GET "/blah" for 127.0.0.1 at Thu Jun 07 19:07:33 +0530 2012   
Processing by Some::Controller#someaction as HTML   Parameters: { "id"=>"31550"}
GET http://somedomain:80/somepath/users.json?some=thing&and=something
--> 200 OK 594 (119.9ms)
Rendered a/b/c/_d.html.haml (1.3ms) 
Rendered x/y/z/_w.html.haml (2ms)
Completed 200 OK in 3529ms (Views: 345.3ms | ActiveRecord:3.0ms)

当并行请求进入时,生产日志可能非常混乱,查看/解析日志不是简单的任务,通常不起作用。

是否有机架/ rails中间件可以根据请求为我的生产设置提供这些数字。像rack-perftools_profiler这样的东西,但给我在rails日志中找到的数字/统计数据(上面的例子)?

rack-perftools_profiler打印分析数据,掩盖请求的实际响应,我可以通过对任何URL使用url param'profile = true'来选择性地执行此操作。

0 个答案:

没有答案