-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
40 lines (24 loc) · 1.69 KB
/
README
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
36
37
38
39
40
RAWK - Rail's Analyzer With Klass v1.2
Created by Chris Hobbs of Spongecell, LLC
This tool gives statistics for Ruby on Rails log files. The times for each request are grouped and totals are displayed. If process ids are present in the log files then requests are sorted by ActionController actions otherwise requests are grouped by url. By default total request times are used for comparison but database time or render time can be used by specifying the correct flag. The log file is read from standard input unless the -f flag is specified.
The options are as follows:
-? Display this help.
-d Use DB times as data points. These times are found after 'DB:' in the log file. This overrides the default behavior of using the total request time.
-f <filename> Use the specified file instead of standard input.
-h Display this help.
-r Use Render times as data points. These times are found after 'Rendering:' in the log file. This overrides the default behavior of using the total request time.
-s <count> Display <count> results in each group of data.
-t Test
-u Group requests by url instead of the controller and action used. This is the default behavior if there is are no process ids in the log file.
-w <count> Display the top <count> worst requests.
-x <date> Date (inclusive) to start parsing in 'yyyy-mm-dd' format.
-y <date> Date (inclusive) to stop parsing in 'yyyy-mm-dd' format.
To include process ids in your log file, add this to environment.rb:
class Logger
def format_message(severity, timestamp, progname, msg)
"#{msg} (pid:#{$$})\n"
end
end
This software is Beerware, if you like it, buy yourself a beer.
Example usage:
ruby rawk.rb < production.log