Skip to content
This repository has been archived by the owner on May 26, 2021. It is now read-only.

Narnach/rails_analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RailsAnalyzer

RailsAnalyzer generates reports about requests processed by a Ruby on Rails server.

It analyzes the log files created by a Rails server. It can accept any number of files as its command line parameters. It defaults to use ‘log/production.log’ as its input when no filenames are provided.

Two different reporting engines process the log files:

  • TimeStats, which is concerned with when the request was made. It produces reports with the amount of hits recorded in the log file per time interval, and the relative amount of requests within a time interval. The relative interval simply lowers all hit counts until one hits zero. This makes it easy to filter out periodic requests.

  • HitStats, which is concerned with how fast the requests were handled. It produces reports with detailed time statistics for each request. It has two types of reports: with params and without params. Each type of report produces a number of files, each which is sorted by one of the following statistics for responses: fastest, slowest, sum, average, median, standard deviation and hit count.

Both engines produce .txt files as their only output.

  • TimeStats produces log_times_*.txt and log_times_*_relative.txt output.

  • HitStats produces the other log_*.txt and log_*_with_params.txt files.

Recent changes

Version 0.2.2

Added reports for slowest and fastest requests. Documentation updates.

Version 0.2.1

Bugfixes:

  • HitStats reports were not generated. They are working again.

  • Array#median always returns a float to prevent integer math (lack of) rounding problems.

Dependencies:

  • No longer rely on ActiveSupport. It was used for Array#sum and Array#group_by, which are now implemented in ArrayExt.

Specs:

  • Parts of UrlHits and Entries got specs to help debugging the HitStats bug.

  • Added specs for all ArrayExt methods.

Version 0.2.0

Split single-file script into one file per existing class. Introduced new classes to handle responsibilities that were not yet handled. Changed classes involved in generating URL hits-based reports to be more flexible. Generally refactored a lot of non-DRY code to be at least a bit nicer.

Version 0.1.0

Imported single-file script

Installation

From gem

The gem is located on github.

gem install Narnach-rails_analyzer -s http://gems.github.com

From git

From the project root, use rake to install:

git clone git://github.com/Narnach/rails_analyzer.git
cd rails_analyzer
rake install

This will build the gem and install it for you.

Syntax

rails_analyzer [log_file1] [log_file2] [..] [log_fileN]

When no log files are provided, log/production.log is used.

About

Author

Wes ‘Narnach’ Oldenbeuving (narnach@gmail.com)

Website

www.github.com/Narnach/rails_analyzer

Copyright

Copyright © 2008 Wes Oldenbeuving

License

MIT license. See MIT-LICENSE (in the gem directory) for license details.

About

RailsAnalyzer generates reports about requests processed by a Ruby on Rails server.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages