Christopher Johnson
Christopher Johnson

Reputation: 695

Get total queries executed in a request

For each request/response I want to print the total number of SQL queries executed for that page request. Is there an easy way to do this in Rails 2.x or 3?

Upvotes: 1

Views: 464

Answers (3)

xxx
xxx

Reputation: 9094

Rack Bug is outdated for Rails 3.

This project is forked and continued development and looks quite good:

https://github.com/LRDesign/logical-insight

Upvotes: 3

nirvdrum
nirvdrum

Reputation: 2319

You can use newrelic_rpm (free for local development use) to get a lot of great info. See how many queries were run, what the actual queries were, total execution time, and even do an EXPLAIN in-line.

Upvotes: 1

apneadiving
apneadiving

Reputation: 115511

There is a great gem which gives you plenty of information in all your pages, have a look at:

https://github.com/brynary/rack-bug

Upvotes: 2

Related Questions