Forum: Ruby on Rails summarize: A log analysis script

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
27d675aee56b7d6385b5add7e5651e71?d=identicon&s=25 Jeremy Wohl (Guest)
on 2006-05-06 00:15
(Received via mailing list)
Hi folks,

I wrote a quick script to extract performance one-liners from Rails
logs.
(Didn't want to futz with syslog for
http://rails-analyzer.rubyforge.org/ .)

Reads output from :info or :debug log levels (the defaults).

Usage:

  # summarize < development.log
  # summarize < production.log

Output looks like:

(w/FULL_URL set false)
  123.23.23.123 2006-05-05 10:59:42 | r 0.0--00  0% | db 0.00812 29% |
0.02726   36 r/s | 302 /some/uri
  123.23.23.123 2006-05-05 10:59:43 | r 0.02059 55% | db 0.01246 33% |
0.03697   27 r/s | 200 /some/uri
  123.23.23.123 2006-05-05 10:59:53 | r 0.00716 68% | db 0.00156 14% |
0.01048   95 r/s | 200 /some/uri
  123.23.23.123 2006-05-05 10:59:57 | r 0.00727 72% | db 0.00109 10% |
0.01005   99 r/s | 200 /some/uri

(w/FULL_URL set true)
  123.23.23.123 2006-05-05 10:59:58 | r 0.0--00  0% | db 0.01137 27% |
0.04104   24 r/s | 302 https://a.b.com/some/uri
  123.23.23.123 2006-05-05 10:59:58 | r 0.0--00  0% | db 0.00064 24% |
0.00255  392 r/s | 302 https://a.b.com/some/uri
  123.23.23.123 2006-05-05 10:59:59 | r 0.08411 79% | db 0.01929 18% |
0.10589    9 r/s | 200 https://a.b.com/some/uri
  123.23.23.123 2006-05-05 11:00:01 | r 0.0--00  0% | db 0.00721 57% |
0.01250   79 r/s | 302 https://a.b.com/some/uri
  123.23.23.123 2006-05-05 11:00:01 | r 0.02212 56% | db 0.01381 35% |
0.03932   25 r/s | 200 https://a.b.com/some/uri
  123.23.23.123 2006-05-05 11:00:05 | r 0.00734 72% | db 0.00109 10% |
0.01011   98 r/s | 200 https://a.b.com/some/uri

(see attached summarize script)

-jeremy
This topic is locked and can not be replied to.