-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
35 lines (20 loc) · 772 Bytes
/
Copy pathREADME
File metadata and controls
35 lines (20 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
DatabaseCounters
================
Adds two database counters to the log for a request:
- total number of requests that were made
- total number of rows that were returned
Example
=======
Enabling in a Controller:
class ApplicationController < ActionController::Base
database_counters :on
# ...
end
Will result in log output like so:
Completed in 847ms (View: 0, DB: 5 Calls: 92 Rows: 671) | 200 OK [http://localhost/]
Or, in older (< 2.2) versions of Rails:
Completed in 0.05835 (17 reqs/sec) | Rendering: 0.00007 (0%) | DB: 0.00265 (4%) Calls: 5 Rows: 6 | 200 OK [http://localhost/]
Support
=======
See <http://9astronauts.com/code/database_counters/>
Copyright (c) 2007-8 Nine Astronauts, released under the MIT license.