wvanbergen / request-log-analyzer
- Source
- Commits
- Network (23)
- Issues (20)
- Wiki (22)
- Graphs
-
Branch:
master
-
2 comments Created 8 months ago by wvanbergenAdd internal design documentation to wikidocumentationxDescribe the pipeline, the related classes and how to extend functionality in the project's wiki.
Comments
-
1 comment Created 8 months ago by wvanbergenImprove RDoc comments in sourcedocumentationx -
2 comments Created 8 months ago by wvanbergenbugxin progressxLine numbers when using multiple filesparserxThe line numbers that are used while parsing relate to the current file, but there is no way of knowing what file the line was in when using multiple files.
Comments
wvanbergen
Tue Sep 08 15:44:51 -0700 2009
| link
This is planned for the 1.3.0 release. The source (file) is already stored in a request database, but some cleaning up is still necessary.
wvanbergen
Mon Sep 14 10:42:50 -0700 2009
| link
This has been resolved in version 1.3.2
-
6 comments Created 8 months ago by wvanbergenCreate a database query toolfeature requestxDesign and build a tool that can easily run queries on a request database that has been created with r-l-a.
Comments
barttenbrinke
Sun Jun 21 13:26:34 -0700 2009
| link
Can't we just abuse irb for this ?
wvanbergen
Mon Jun 22 12:30:24 -0700 2009
| link
Maybe, but it would be nice to get some helper functions that make this easier. The database structure requires a lot of JOINs.
barttenbrinke
Mon Jun 22 13:12:40 -0700 2009
| link
Yeah, but you could just spawn an IRB with some method missing magic, right?
wvanbergen
Mon Jun 22 13:35:17 -0700 2009
| link
Or offer something like Rails, which starts IRB with some libraries that are loaded when starting. You can specify requires on the irb command line.
barttenbrinke
Mon Jun 22 13:36:21 -0700 2009
| link
That's what I meant :)
wvanbergen
Tue Sep 08 15:37:14 -0700 2009
| link
I added an IRB console to inspect a database that initializes automatically for the upcoming r-l-a release (version 1.3).
Start the console with:
request-log-analyzer console --database <DATABASE> --format <FORMAT>The following ActiveRecord classes will be available:
- Request
- Source
- Warning
- A class generated for every line type: :access -> AccessLine, :completed => CompletedLine, etc.
-
11 comments Created 7 months ago by davidchuadatabase inserterxfeature requestxin progressxContinous Parsing of Logs to be appended into databaseparserxIs there anyway to do continuous logging of *.logs such that after an inital parse of a log into a sqlite3 database, RLA would monitor the log and append the changes since the last parse date into the database?
That way old logs even after it gets rotated, will still be recorded into the database.
Comments
wvanbergen
Fri May 29 07:05:52 -0700 2009
| link
You can emulate behavior like this using the UNIX tail command, and piping the result through RLA:
tail -f log/production.log | request-log-analyzer --database log/requests.db -
(don't forget the dash on the end to indicate that you are parsing the standard input)However, this will create a new database, so it is not possible to "resume" to a previous database file. Adding that feature would be nice indeed. :-)
wvanbergen
Mon Jun 15 09:04:53 -0700 2009
| link
Continuous parsing will require to check the database schema, to see whether the old structure is compatible with the file that is being parsed.
barttenbrinke
Mon Jun 22 14:51:30 -0700 2009
| link
I have a rails logger here that just logs everything to the database instead of to file. I'll see if it is easily adaptable
wvanbergen
Mon Jun 22 22:43:56 -0700 2009
| link
I think directly adding request to the database from Rails is outside the scope of RLA. Moreover, I doubt that this approach will work to make it compatible with other file formats.
IMHO, a better approach is to simply parse the logs and append it to the existing database file. However, before we can add data, we need to check whether the database schema is compatible, which depends on the log format specification. Currently, the old database file is simply deleted at the beginning, wiping all old data.
As a bonus, we could detect if the parsed request data is already inserted into the database to avoid duplicate data. This is a little bit more complex on first sight, as requests do not have a unique identifier.
barttenbrinke
Tue Jun 23 06:03:22 -0700 2009
| link
That sounds like a major performance hog
wvanbergen
Tue Jun 23 06:06:11 -0700 2009
| link
If you mean the last idea: without some kind of a unique index, indeed. However, maybe a unique index using the timestamp, IP address and controller/action of the request might be acceptable.
wvanbergen
Tue Jun 23 06:09:05 -0700 2009
| link
Another idea: store the filenames (including last modified date) that have been parsed and iserted into the database in a separate table to keep track of what has been parsed and what not.
danlucraft
Wed Jul 29 03:58:19 -0700 2009
| link
Yes to your last comment wvanbergen.
wvanbergen
Tue Aug 18 11:07:42 -0700 2009
| link
Apparently, danlucraft started working on this
wvanbergen
Tue Sep 08 15:43:24 -0700 2009
| link
Status update:
- A database will not be cleared when parsing starts (unless
--reset-databaseis given as an option). - Parsed files are now stored in the
sourcestable, including the filesize and mtime at the moment of parsing.
Still to do:
- Check if the database schema still matches the file format
- Allow resuming by skipping the first
nbytes of a file.
wvanbergen
Thu Oct 01 04:46:39 -0700 2009
| link
I have created new issues for the outstanding TODOs, but basically the continuous parsing works now.
- A database will not be cleared when parsing starts (unless
-
Comments
barttenbrinke
Fri Jun 12 03:23:14 -0700 2009
| link
Fixed in current master
-
3 comments Created 6 months ago by wvanbergendatabase inserterxfeature requestxin progressxAllow other DB connectionspatchxAllow other kinds of DB connections besides MySQL, for example by allowing a YAML configuration file with DB connection parameters.
Comments
wvanbergen
Tue Aug 18 11:09:57 -0700 2009
| link
Danlucraft's fork has implemented this feature, but as of yet it is untested and cannot be merged for that reason.
wvanbergen
Tue Sep 08 10:14:06 -0700 2009
| link
I have implemented this feature, which will be included in version 1.3. You can provide connection information by passing a connection string to the
--databasecommand line option. The connection string can be in two formats:- ODBC:
adapter=sqlite3;database=requests.db - URI:
mysql://username:password@localhost/database_name
The parameter names for the ODBC query should be the same as the ActiveRecord connection parameters.
The
--reset-databasecommand line switch makes sure that the database is cleared before the parsing begins.
wvanbergen
Tue Sep 08 10:15:45 -0700 2009
| link
Of course, passing
--database filename.dbstill works as expected using an SQLite3 database - ODBC:
-
7 comments Created 6 months ago by wvanbergenAllow parsing of compressed log filesfeature requestxAllow parsing compressed files. This can be auto-detected using the filename extension, e.g. .gz.
Maybe it is possible to decompress the file in small parts, in order to keep the memory usage down. Otherwise, the files can be decompressed into a temporary file.
Comments
barttenbrinke
Sat Jun 20 12:35:51 -0700 2009
| link
Do we really want to do this? The idea of linux tools is that they do 1 thing and they do it good. You could just pipe a tar.gz file trough tar and through rla, right? Maybe add an example of this to the examples.
wvanbergen
Sat Jun 20 12:37:48 -0700 2009
| link
That approach does not work if you want to parse multiple files at once (production.3000.log.gz, production.3001.log.gz, etc.)
wvanbergen
Sat Jun 20 12:38:52 -0700 2009
| link
Of course, .bz2 and maybe .zip files could be supported as well.
barttenbrinke
Sat Jun 20 12:39:09 -0700 2009
| link
Sombody agrees with me :) : http://snippets.aktagon.com/snippets/245-How-to-unzip-gunzip-untar-files-with-Ruby
barttenbrinke
Sat Jun 20 12:40:40 -0700 2009
| link
Just calling the system util would be pretty acceptable I guess..
barttenbrinke
Sun Jun 21 04:38:53 -0700 2009
| link
Added basic gz, bz2 and zip support to master. Needs specs + checking :).
barttenbrinke
Sun Jun 21 13:01:20 -0700 2009
| link
The progress bar is not working for gzipped files, but as the decompressors just dump a single string as stdout, this is not an easy fix, so I've closed this ticket. Specs are also added for gz tgz zip and bz2. We need release notes :)
-
2 comments Created 6 months ago by wvanbergenfeature requestxParseable YAML reportsin progressxAllow returning the reports in an easy-to-parse format, like YAML. This allows easily comparing different reports with automated tools.
Comments
wvanbergen
Mon Jun 22 12:31:33 -0700 2009
| link
Basic YAML reports have been implemented, using the --dump command line switch. The YAML dump contains all the results, not only the top 20 which are displayed in a normal.
Needs RDOC and specs.
wvanbergen
Mon Jun 22 13:32:57 -0700 2009
| link
Added RDOC and specs
-
9 comments Created 5 months ago by wvanbergenfeature requestxAdd --email options to email the resultsreportingxThis may be useful when used with a cronjob to do periodical analysis on an application's logs. Adding an example cronjob would be nice as well for reference.
Comments
wvanbergen
Tue Jul 21 08:29:11 -0700 2009
| link
Maybe we can use Pony (http://adam.blog.heroku.com/past/2008/11/2/pony_the_express_way_to_send_email_from_ruby/)? Pony can send using sendmail or smtp. It does require TMail however, so we would add two dependencies for this feature.
If we would simply use (command line) sendmail for sending the email, we can implement it without dependencies. This will not work on Windows however.
barttenbrinke
Tue Jul 21 10:42:55 -0700 2009
| link
I'd rather do this: simpler and more crossplatform:
http://snippets.dzone.com/posts/show/2362
wvanbergen
Sat Jul 25 00:06:03 -0700 2009
| link
Is localhost usable as SMTP server on every platform?
barttenbrinke
Wed Jul 29 04:24:58 -0700 2009
| link
Let them specify a host if they want to use a different one. Most server environemnts will have either mailing from localhost or something like a mail.internal host.
barttenbrinke
Wed Jul 29 04:26:41 -0700 2009
| link
def send_email(to, message, host = 'localhost') msg = <<END_OF_MESSAGE From: #{from_alias} <#{from}> To: #{to_alias} <#{to}> Subject: #{subject} #{message} END_OF_MESSAGE Net::SMTP.start(host) do |smtp| smtp.send_message msg, from, to end end
wvanbergen
Wed Jul 29 05:04:26 -0700 2009
| link
What about Windows? Moreover, most server environments also have sendmail (or a drop-in replacement) installed. Using the sendmail binary, we would not have to add the NET::SMTP dependency.
barttenbrinke
Wed Jul 29 05:58:26 -0700 2009
| link
NET::STMP works on windows, if you specify the SMTP host. And we could just require Net::STMP when needed. Is it part of default ruby? backticking mail seems a bit ugly when replacing just a single command.
barttenbrinke
Fri Sep 11 12:26:00 -0700 2009
| link
a1f8c26..56c91fb master -> master
wvanbergen
Sat Sep 12 06:23:01 -0700 2009
| link
Nice work (y)
-
6 comments Created 5 months ago by barttenbrinkefeature requestxin progressxMunin extentionpatchxAs request log analyzer can very easily be used to find any errors that occured in say the last five munites, whould a munin extention be a good addition?
Comments
wvanbergen
Wed Jul 29 05:05:43 -0700 2009
| link
Maybe such an extension can be created as a separate project?
barttenbrinke
Wed Jul 29 05:59:53 -0700 2009
| link
Extension is now available in /lib/rla_tracker :)
barttenbrinke
Wed Jul 29 14:43:23 -0700 2009
| link
Also a wiki page is now available.
Should I move it to a new project called munin-rails-plugins ?
wvanbergen
Wed Jul 29 22:42:02 -0700 2009
| link
I am for a separate project. The file in question is buried somewhere in the tree, is is not part of the application itself, so nobody will find this kind of functionality.
Moreover, you may want to add some (rake) scripts to ease the installation, which would be out of place in the current r-l-a repo.
barttenbrinke
Thu Jul 30 04:41:50 -0700 2009
| link
True. However, r-l-a is great for this. I have really cool munin graphs :)
As there allready is a rails-munin app, how should I call it? munin-rails-plugins?
barttenbrinke
Thu Jul 30 16:04:48 -0700 2009
| link
-
I can parse a log file successfully, but when I attempt to save the results into a sqlite file, I get the error described below. Does this file need to already exist? Help text says the RLA will create it for me, so I have not created the database file before running the command below.
$ rails --version Rails 2.2.2
$ ruby --version ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.6.0]$ request-log-analyzer --database web2.db log/ipsm_dev_oracle.log Request-log-analyzer, by Willem van Bergen and Bart ten Brinke - version 1.2.1
Website: http://railsdoctors.com/opt/software/wxweb/opt/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)
from /opt/software/wxweb/opt/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:121:in `retrieve_connection' from /opt/software/wxweb/opt/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:113:in `connection' from /opt/software/wxweb/opt/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:346:in `method_missing' from /opt/software/wxweb/opt/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:326:in `say_with_time' from /opt/software/wxweb/opt/lib/ruby/1.8/benchmark.rb:293:in `measure' from /opt/software/wxweb/opt/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:326:in `say_with_time' from /opt/software/wxweb/opt/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:342:in `method_missing' from /opt/software/wxweb/opt/lib/ruby/gems/1.8/gems/wvanbergen-request-log-analyzer-1.2.3/bin/../lib/request_log_analyzer/aggregator/database.rb:141:in `create_request_table_and_class' from /opt/software/wxweb/opt/lib/ruby/gems/1.8/gems/wvanbergen-request-log-analyzer-1.2.3/bin/../lib/request_log_analyzer/aggregator/database.rb:166:in `create_database_schema!' from /opt/software/wxweb/opt/lib/ruby/gems/1.8/gems/wvanbergen-request-log-analyzer-1.2.3/bin/../lib/request_log_analyzer/aggregator/database.rb:27:in `prepare' from /opt/software/wxweb/opt/lib/ruby/gems/1.8/gems/wvanbergen-request-log-analyzer-1.2.3/bin/../lib/request_log_analyzer/controller.rb:193:in `run!' from /opt/software/wxweb/opt/lib/ruby/gems/1.8/gems/wvanbergen-request-log-analyzer-1.2.3/bin/../lib/request_log_analyzer/controller.rb:193:in `each' from /opt/software/wxweb/opt/lib/ruby/gems/1.8/gems/wvanbergen-request-log-analyzer-1.2.3/bin/../lib/request_log_analyzer/controller.rb:193:in `run!' from /opt/software/wxweb/opt/lib/ruby/gems/1.8/gems/wvanbergen-request-log-analyzer-1.2.3/bin/request-log-analyzer:93 from /opt/software/wxweb/opt/bin/request-log-analyzer:19:in `load' from /opt/software/wxweb/opt/bin/request-log-analyzer:19Comments
wvanbergen
Mon Aug 31 12:07:44 -0700 2009
| link
The exact same syntax works for me. What version of the sqlite3-ruby gem do you have installed? Use "gem list sqlite" to see what versions are available. I am using sqlite3-ruby version 1.2.4.
I installed the newly-released request-log-analyzer-1.2.4, and no longer encounter this error. Thanks!
wvanbergen
Tue Sep 01 06:44:32 -0700 2009
| link
This was fixed by more robust handling of connections for the table migrations.
-
Introduce parallelization to speed up parsing. Some ideas:
- Try the regexps for every line type in parallel.
- Parse multiple lines at once.
Comments
barttenbrinke
Fri Sep 11 12:53:13 -0700 2009
| link
barttenbrinke
Fri Sep 11 12:53:30 -0700 2009
| link
barttenbrinke
Fri Sep 11 13:49:05 -0700 2009
| link
Tried parallelizing parse line. The thread construction used about the same time as the consecutive regexp parsing. Either that or my threads are not working :).
barttenbrinke
Fri Sep 11 14:03:05 -0700 2009
| link
file_format.rb
# Parses a line by trying to parse it using every line definition in this file format def parse_line(line, &warning_handler) request_data = nil threadpool = [] request_data = nil count = 0 self.line_definitions.each do |lt, definition| count = count + 1 threadpool << Thread.new(lt) do |lt| match = definition.matches(line, &warning_handler) request_data = match if match end end threadpool.each { |t| t.join } return request_data end
barttenbrinke
Fri Sep 11 14:06:36 -0700 2009
| link
Wow, just removed a significant bug in parse_line. RLA is now about 3 times faster :)
wvanbergen
Tue Sep 22 09:34:44 -0700 2009
| link
I tried to parse multiple lines in parallel. It works fine, but it does not yield any performance gains because of the lousy threading implementation in Ruby. It does increase performance when using JRuby though, but JRuby is way slower to begin with :-)
Because of these findings, parallelization will not be implemented in the master branch, but I saved experimental code in the
multithreadedbranch if someone is interested.
barttenbrinke
Tue Sep 22 10:26:26 -0700 2009
| link
Parked :D
wvanbergen
Tue Nov 03 00:20:15 -0800 2009
| link
Another idea: forking instead of threads. This should work better on UNIX platforms.
Issues to keep track of: the amount of processes / processor cores ratio, etc.
barttenbrinke
Tue Nov 03 11:18:37 -0800 2009
| link
After talking with Eloy I think this should be parked until MacRuby, Ruby 1.9 or JRuby because they have basic threading support. You could take a look at the rvm gem. http://rvm.beginrescueend.com/
-
We always forget to update the version constant. The version in the .gemspec file is always correct, so we could use the value specified there.
Comments
barttenbrinke
Tue Sep 01 09:58:13 -0700 2009
| link
With we, you mean you :)?
wvanbergen
Tue Sep 01 09:58:52 -0700 2009
| link
I always use the royal plural. ;)
barttenbrinke
Tue Sep 01 09:59:51 -0700 2009
| link
Excuse me your highness :P
wvanbergen
Tue Sep 01 10:39:22 -0700 2009
| link
OK, we have now fixed this high-priority issue on master!
barttenbrinke
Thu Sep 03 07:23:13 -0700 2009
| link
Nice work :)
-
3 comments Created 3 months ago by barttenbrinkefeature requestxProvide better API interface for RLAin progressxOne other minor issue I've had with RLA is wishing there was an API that more closely mirrored the command-line invocation. For example, I wish I could use it like a library sort of like:
result = StringIO.new RequestLogAnalyzer.analyze( log, :after => start_time, :output => "HTML", :file => result )Comments
wvanbergen
Mon Sep 14 10:10:24 -0700 2009
| link
This would be nice as well for reading a configuration from a config file (see issue #16)
This may require rewriting the command line option parsing and handling. In that case, we may switch to optparse, the standard ruby library for this.
barttenbrinke
Tue Sep 22 15:15:31 -0700 2009
| link
Command line now uses Base API.
# TODO: # Check if defaults work (Aggregator defaults seem wrong). # Refactor :database => options[:database], :dump => options[:dump] away from contoller intialization.
barttenbrinke
Wed Sep 30 11:28:01 -0700 2009
| link
Good enough for now
-
1 comment Created 3 months ago by wvanbergenfeature requestxTraffic trackerreportingxA tracker, similar to the duration tracker, to keep track of the total amount of traffic. Apache access logs and Amazon S3 access log contain fields about the number of bytes sent, which can be analyzed by such a tracker.
Comments
wvanbergen
Wed Sep 16 01:29:27 -0700 2009
| link
Available in HEAD
-
1 comment Created 3 months ago by wvanbergenfeature requestxparkedxSources trackerreportingxA tracker to keep track of the sources that were parsed. The same information is already stored when using the database inserter. Using the
--dumpfunctionality to store this information after a parsing run, this can be used to implement resuming.Comments
wvanbergen
Thu Oct 01 04:49:17 -0700 2009
| link
This functionality should first work with the database inserter, afterwards it can be improved to work using the
--dumpoutput as well. -
3 comments Created 3 months ago by bananastalktomefeature requestx--report-amount command line switchreportingxIt would be nice to have an --amount command line switch to toggle the number of hits returned in the output, be it HTML, plain text, or yaml, with the ability to specify a particular number or unlimited.
Comments
wvanbergen
Tue Sep 22 09:29:18 -0700 2009
| link
The switch is probably going to be called
--report-amount.
wvanbergen
Wed Sep 23 07:06:04 -0700 2009
| link
I will also add a command line option
--report-sort mean,sum,stddevto specify what tables should be included in the report and how these tables should be sorted.--report-sort mean,stddev,sum: Sort results by mean, sum and standard deviation. This will display 3 different tables.--report-amount 20: Only show the top 20 results for every sorting/table.--report-amount all: Show all the results for every sorting/table.
wvanbergen
Thu Sep 24 08:37:10 -0700 2009
| link
These command line switches are now available in HEAD and will show up in the next release.
-
1 comment Created 3 months ago by wvanbergenfeature requestxin progressxAdd standard deviation to duration and traffic reportsreportingxFor one-pass algorithms to do this, see http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
Comments
wvanbergen
Tue Sep 22 13:09:22 -0700 2009
| link
Standard deviation calculation has been added.
-
I run (in my project):
request-log-analyzer log/development.log
Outputs nothing of value, but I see warning:
... Warnings: teaser_check_failed: 312, no_current_request: 302
...It worked for me before I updated the gem yesterday.
Comments
wvanbergen
Thu Oct 01 07:21:18 -0700 2009
| link
Hmmm, it seems to be working fine for me. Can you maybe send (the first part of) your log file to me? You can send it to willem@railsdoctors.com
It worked after I cleared the logs. Too late! ;) I'll do that if I get the same error again. Thanks.
wvanbergen
Thu Oct 01 07:32:30 -0700 2009
| link
OK, maybe there was some strange cruft left in the old log files that r-l-a couldn't handle. Happy to hear it works for you again!
-
To ensure that everything works to mail reports, including the
--mailcommand line option.Comments
barttenbrinke
Thu Nov 05 05:37:08 -0800 2009
| link
How can you test that easily? Spawn a mail server with something like pony and then wrap around?
wvanbergen
Thu Nov 05 05:44:22 -0800 2009
| link
IMHO, the most important thing to test is that the
--mailcommand line argument actually invokes the mailer component. The actual SMTP stuff is less important. Maybe we can check if the appropriate Net::SMTP method is called?
barttenbrinke
Thu Nov 05 06:47:16 -0800 2009
| link
Can we set up some oneliner SMTP server in ruby to catch the email?
barttenbrinke
Thu Nov 05 06:51:15 -0800 2009
| link
How does rails test actionmailer?
barttenbrinke
Thu Nov 05 09:14:40 -0800 2009
| link
This looks interesting: http://snippets.dzone.com/posts/show/3932
barttenbrinke
Thu Nov 05 09:16:25 -0800 2009
| link
Apparently Mailtrap is designed specifically for this: http://matt.blogs.it/entries/00002655.html http://rubymatt.rubyforge.org/mailtrap/
barttenbrinke
Thu Nov 05 09:18:11 -0800 2009
| link
Wow. that should be damn simple:
Remove mailtrap log
mailtrap start
request-log-analyzer start
mailtrap stop
Check if mail was received in mailtrap logBut it will add a requirement to the test suite.. Which should be pretty ok I Guess
barttenbrinke
Thu Nov 05 11:27:20 -0800 2009
| link
afd95ca..5b2d042 via mailtrap
-
output html for report with rack format throw exception undefined method `colorize'
1 comment Created about 1 month ago by jessywhen I use this set of options on a rack formatted log file :
request-log-analyzer --format rack log_file.log --output htmlthe html report is printed but a exception is finally thrown :
/Library/Ruby/Gems/1.8/gems/request-log-analyzer-1.5.0/bin/../lib/request_log_analyzer/tracker/traffic.rb:92:in
report': undefined methodcolorize' for #<RequestLogAnalyzer::Output::HTML:0x531178> (NoMethodError)from /Library/Ruby/Gems/1.8/gems/request-log-analyzer-1.5.0/bin/../lib/request_log_analyzer/aggregator/summarizer.rb:128:in `report' from /Library/Ruby/Gems/1.8/gems/request-log-analyzer-1.5.0/bin/../lib/request_log_analyzer/aggregator/summarizer.rb:128:in `each' from /Library/Ruby/Gems/1.8/gems/request-log-analyzer-1.5.0/bin/../lib/request_log_analyzer/aggregator/summarizer.rb:128:in `report' from /Library/Ruby/Gems/1.8/gems/request-log-analyzer-1.5.0/bin/../lib/request_log_analyzer/controller.rb:327:in `run!' from /Library/Ruby/Gems/1.8/gems/request-log-analyzer-1.5.0/bin/../lib/request_log_analyzer/controller.rb:327:in `each' from /Library/Ruby/Gems/1.8/gems/request-log-analyzer-1.5.0/bin/../lib/request_log_analyzer/controller.rb:327:in `run!' from /Library/Ruby/Gems/1.8/gems/request-log-analyzer-1.5.0/bin/request-log-analyzer:116 from /usr/bin/request-log-analyzer:19:in `load' from /usr/bin/request-log-analyzer:19Comments
wvanbergen
Wed Nov 18 18:41:27 -0800 2009
| link
I fixed this issue. Please install version 1.5.1.
-
0 comments Created 8 months ago by wvanbergenUse a request database as a source in the request pipelinefeature requestxComments
-
4 comments Created 8 months ago by wvanbergenAPIxAdd specs for FileFormat subclassingspecsxComments
barttenbrinke
Thu Oct 08 14:13:06 -0700 2009
| link
What do you want to have speced? That they actually parse these filetypes?
wvanbergen
Fri Oct 09 02:21:23 -0700 2009
| link
For example, you can do this:
class MyFileFormat < RequestLogAnalyzer::FileFormat::Rails # Add some additional lines here besides the standard Rails lines # Also, add some trackers to the report. # Hack the request class class Request < RequestLogAnalyzer::FileFormat::Rails::Request # hack the request class here end endSee http://wiki.github.com/wvanbergen/request-log-analyzer/creating-your-own-file-format-definition for more information. This should behave as expected and currently is completely unspeced. We use this at Floorplanner to parse some of the custom lines we add to our log, like the current user and his account type.
barttenbrinke
Mon Dec 14 07:22:48 -0800 2009
| link
So what do you want to spec? The hacks?
wvanbergen
Mon Dec 14 10:19:48 -0800 2009
| link
- When subclassing a file format, all line types of the parent file format should be parsed, and the newly added line types should be parsed as well.
- The parent file format should be left unchanged (so it should not parse any of the added line types).
The last bullet seems very logical/simple, but I really struggled to get this working correctly when I was implementing fileformat subclassing.
The same points can be made for the report trackers.
-
0 comments Created 8 months ago by wvanbergenAPIxAdd specs for request summary report definitionspecsxComments
-
2 comments Created 6 months ago by wvanbergenRails project integration brainstormfeature requestxWe could improve integration with a Rails project. This tickets contains some ideas to accomplish this:
Settings
- Request database connection in config/database.yml (see also #10). This way, it could even be accessed from the rails application itself :-)
- Store settings in config/rla.yml
- Store log filename pattern per environment in settings file (e.g. production.*.log.gz)
Rake tasks
rla:reportRun rla on and return ASCII report in terminalrla:report:htmlRun rla and create a HTML reportrla:report:yamlRun rla and create raw YAML report (se #13)rla:databaseParse request log and store requests in databaserla:database:resetClear the request database
Other ideas
- Archive reports (with date in filename) on a default location so comparisons are possible (e.g. /doc/performance)
- Run r-l-a as cronjob?
Comments
barttenbrinke
Sun Jun 21 13:32:17 -0700 2009
| link
rla:report and rla:report:html are allready there.
wvanbergen
Tue Aug 18 11:17:18 -0700 2009
| link
Separated out config file to separate issue (see #16)
-
0 comments Created 4 months ago by wvanbergenSupply settings file using --config optionfeature requestxAllow every command line option to be set using a configuration file. This file should probably be in YAML format and should be provided with the
--configoption.Comments
-
2 comments Created 4 months ago by wvanbergenfeature requestxAllow skipping first n bytes of fileparserxAdd --skip-bytes option to skip the first n bytes of a file. This makes it easier to not parse duplicate data.
Comments
barttenbrinke
Fri Sep 11 12:28:13 -0700 2009
| link
Wouldn't a skip-lines option be more logical?
wvanbergen
Sat Sep 12 06:22:10 -0700 2009
| link
Maybe that would be a nice feature as well, but bytes is useful to implement resuming, as you can simply store the filename, mtime and filesize of every logfile (which is what the database inserter already does). By skipping these bytes if the file has become bigger since the last parse, you can resume parsing a log that has new information in it.
-
3 comments Created 3 months ago by barttenbrinkeHave --after use more intelligence than it does nowfeature requestxLike parsing from back to front to determine starting position if after was given and file bigger than x bytes.
Comments
barttenbrinke
Sun Sep 13 03:40:11 -0700 2009
| link
def read_backwards_to_timestamp(path, timestamp) start = nil Elif.open(path) do |elif| elif.each do |line| if line =~ /\AProcessing .+ at (\d+-\d+-\d+ \d+:\d+:\d+)\)/ time_of_request = Time.parse($1) if time_of_request < timestamp break else start = elif.pos end end end end file = open(path) file.seek(start) if start file end
wvanbergen
Sun Sep 13 05:13:33 -0700 2009
| link
Maybe a binary search through the file is even faster :-)
However, the above implementation is very Rails specific. I don't know if this can be implemented in a file formated agnostic way.
barttenbrinke
Thu Oct 01 11:34:45 -0700 2009
| link
We could try to parse every line into a date :) Or have each file definition define a date_finder teaser regexp?
-
0 comments Created 3 months ago by wvanbergenfeature requestxAdd a --no-report optionreportingxTo speeds up parsing when you're not interested in the report, but only want a request database. This can boost performance and requires significantly less memory when there are a lot of request categories.
Comments
-
0 comments Created 3 months ago by wvanbergenfeature requestxlanguage formatsxAdd line_prefix option to FileFormatsparserxAllow specifying the line prefix for the file format. This may speed up parsing the file because the parser only has to check the beginning of the line for a match.
file_format.line_prefix = :any: allow any prefix (current behavior)file_format.line_prefix = 123: Every line has a prefix of 123 charactersfile_format.line_prefix = /line prefix regexp/: Every line starts with the given regexp.
The file_format's regular expressions will be adjusted accordingly. This option may be supplied to r-l-a using a command line switch like
--line-prefixComments
-
0 comments Created 3 months ago by wvanbergendatabase inserterxAdd specs to test the database consolespecsxAdd tests to ensure the database console is working as expected.
Comments
-
0 comments Created 3 months ago by wvanbergenfeature requestxAdd an index checking tracker for optimizing SQL queriesparserxAdd a SQL index checker to see whether indexes are set for the most popular queries, if the log file contains SQL queries.
For inspiration, see: http://github.com/samdanavia/ambitious_query_indexer
Comments
-
5 comments Created 3 months ago by wvanbergenbugxCheck database schema compatibilitydatabase inserterxBefore parsing requests into an existing database, check if the database schema is compatible with the file format. Currently, it will not insert all information or crash if the database schema is different from the file format.
Comments
barttenbrinke
Fri Nov 06 12:58:30 -0800 2009
| link
We should switch to mongodb. High performance Schema-less Database.
wvanbergen
Sat Nov 07 00:27:02 -0800 2009
| link
I don't think we should switch to MongoDB because it is a rather non-standard piece of technology, but offering it as an alternative is a good idea. Isn't there a MongoDB ActiveRecord mapper we can use?
barttenbrinke
Sat Nov 07 04:11:18 -0800 2009
| link
I think you should read up on Schemaless Databases. They are fundamentally different from relational databases, therefore a MongoDB ActiveRecord adapter whould be pretty useless. Especially if you are exploiting the specific benefits of a schemaless database. Datamapper is trying to build something that can do both, but a swap in is impossible.
wvanbergen
Sat Nov 07 23:17:24 -0800 2009
| link
My problem is that something like MongoDB is not that well known with most developers. Moreover, why should we choose MongoDB over CouchDB? Therefore, I don't think we should ditch the current RDBMS implementation.
Offering MongoDB as an alternative besides the current DBMSs is a better option IMHO. This is most easily possible if there is an AR adapter for MongoDB.
barttenbrinke
Mon Nov 09 12:28:26 -0800 2009
| link
Couch is for scaling, Mongo is for performance. The reason I think we should switch is that by using a schemaless DB, all our DB problems will go away. Things like indexes and dynamic columns will work out of the box.
Both should work through the datamapper adapter, but mongomapper is more stable.
-
0 comments Created 3 months ago by wvanbergendatabase inserterxResume parsing according to sources table in databasefeature requestxUse the records in the sources table in the database to skip the first part of a file if that was already parsed before.
Comments
-
0 comments Created 2 months ago by wvanbergenAPIxRewrite command line options using optparsedocumentationxDitch our current custom command line options parser for a standard parser using the optparse library. After this is finished, create a wiki page with all command line options.
Comments
-
0 comments Created 2 months ago by wvanbergenbugxFill source_id in warnings tabledatabase inserterxCurrently, the
source_idfield in the warnings table will always be filled withNULL.Comments
-
0 comments Created 2 months ago by wvanbergendatabase inserterxCreate indices after parsing hash finishedfeature requestxThis way, the DBMS does not have to update every index over and over when inserting new records
Comments
-
Make a screencast to demonstrate the tool.
Comments
barttenbrinke
Tue Nov 03 08:59:46 -0800 2009
| link
I could ask Geoffrey from peepcode. He still ows me one for lending my vga adapter at RailsConf Berlin :)
-
Is it a good idea to start a mailing list so people can get help using r-l-a?
Comments
-
0 comments Created 22 days ago by wvanbergenfeature requestxAdd PDF output possibilityreportingxAdd a new output class that creates a PDF report.
Comments
-
0 comments Created 22 days ago by wvanbergenfeature requestxAllow more customization of outputreportingxAllow output classes to override the output of a tracker to allow for more beautiful reports.
Comments
- API▾
- bug▾
- database inserter▾
- documentation▾
- feature request▾
- in progress▾
- language formats▾
- parked▾
- parser▾
- patch▾
- reporting▾
- specs▾
- Apply to Selection
-
Change Color…
Preview:preview
- Rename…
- Delete





Some internal design documentation can already be found in the DESIGN file.
http://github.com/wvanbergen/request-log-analyzer/wikis/design