MongoDB 如何输出 Mongoid 的查询性能日志?

suupic · 2012年03月09日 · 最后由 suupic 回复于 2012年03月09日 · 3042 次阅读

@huacnlee 在你 blog 里看到这样的记录 这样的日志是如何生成的?我只能看到 Views 的统计,用的也是 mongoid

# ActiveRecord
Completed 200 OK in 179ms (Views: 169.0ms | ActiveRecord: 9.2ms)
Completed 200 OK in 177ms (Views: 167.4ms | ActiveRecord: 8.1ms)
Completed 200 OK in 116ms (Views: 105.5ms | ActiveRecord: 8.3ms)
Completed 200 OK in 110ms (Views: 99.2ms | ActiveRecord: 9.6ms)
Completed 200 OK in 191ms (Views: 181.5ms | ActiveRecord: 8.5ms)
Completed 200 OK in 192ms (Views: 180.7ms | ActiveRecord: 10.2ms)

# Mongoid
Completed 200 OK in 192ms (Views: 117.4ms | Mongo: 73.8ms | Solr: 0.0ms)
Completed 200 OK in 378ms (Views: 298.9ms | Mongo: 77.8ms | Solr: 0.0ms)
Completed 200 OK in 214ms (Views: 138.7ms | Mongo: 73.9ms | Solr: 0.0ms)
Completed 200 OK in 185ms (Views: 120.9ms | Mongo: 63.0ms | Solr: 0.0ms)
Completed 200 OK in 186ms (Views: 122.2ms | Mongo: 63.0ms | Solr: 0.0ms)
Completed 200 OK in 207ms (Views: 140.1ms | Mongo: 66.0ms | Solr: 0.0ms)



需要 登录 后方可回复, 如果你还没有账号请 注册新账号