Permalink
Browse files

Added README.

  • Loading branch information...
1 parent f1d2969 commit 4d3328f0415ef4bc8a0bc8c040e01553f8ad481b @josevalim josevalim committed Feb 15, 2010
Showing with 76 additions and 8 deletions.
  1. +3 −0 CHANGELOG.rdoc
  2. +58 −0 README.rdoc
  3. +1 −0 TODO.rdoc
  4. +9 −5 lib/generators/rails_metrics_generator.rb
  5. +1 −1 lib/rails_metrics/version.rb
  6. +4 −2 rails_metrics.gemspec
View
@@ -0,0 +1,3 @@
+== 0.1
+
+* First release of RailsMetrics by José Valim. It includes generators for bootstrap, stores instrumentations using a in process Queue and works as engine allowing you to see your metrics. The only ORM supported so far is ActiveRecord.
View
@@ -0,0 +1,58 @@
+== RailsMetrics
+
+RailsMetrics is an engine that hooks into your application to listen ActiveSupport::Notifications and show you statistics about them. RailsMetrics uses threads to save those notifications in the database through an in-process Queue. You can see charts based on each request and see what queries, actions, templates rendering, etc. are slow.
+
+So far RailsMetrics supports only ActiveRecord as ORM but adding other datastore should be easy (take a look at lib/rails_metrics/orm/active_record.rb). Due to the threaded behavior in RailsMetrics, you cannot use SQLite as database, however MySQL and PostgreSQL work fine.
+
+There's an example application at http://github.com/engineyard/rails_metrics_example .
+
+== Installation
+
+Installing RailsMetrics is simple. Since it's a Rails::Engine, you need to install it as gem:
+
+ gem install rails_metrics
+
+Then add it to your gemfile. So far, I recommend you to install it only on development:
+
+ group :development do
+ gem "rails_metrics"
+ end
+
+Finally, create your model using the built-in generator:
+
+ rails g rails_metrics Metric
+
+You can choose another name than Metric as your rails metrics store. Run the created migration, restart your server and now you should be able to access "/rails_metrics". Navigate on your application and head back to "/rails_metrics" to see the stored data.
+
+== Configuration
+
+There are three parameters you can add to your application to configure RailsMetrics. The first one is to set the RailsMetrics store, which is done automatically when you use the generator:
+
+ config.rails_metrics.set_store = lambda { ::Metric }
+
+The other parameters allows you to ignore an specific notification, based on a given block
+or on its name. Let's suppose you have a plugin in your application which is yielding an useless notification. You can silence it by doing:
+
+ config.rails_metrics.ignore_patterns << /verbose_plugin/
+
+If you need to ignore a notification based on its payload, it's also easy:
+
+ config.rails_metrics.ignore_lambdas[:verbose_plugin] = lambda { |name, payload|
+ payload[:some_value] =~ /some_expression/
+ }
+
+== TODO
+
+Please refer to TODO file.
+
+== Maintainers
+
+* José Valim (http://github.com/josevalim)
+
+== Bugs and Feedback
+
+If you discover any bugs or want to drop a line, feel free to create an issue on GitHub.
+
+http://github.com/engineyard/rails_metrics/issues
+
+MIT License. Copyright 2010 Engine Yard. http://www.engineyard.com
View
@@ -0,0 +1 @@
+* Allow to set the maximum number of requests to store
@@ -1,13 +1,21 @@
class RailsMetricsGenerator < Rails::Generators::NamedBase
class_option :migration, :type => :boolean, :default => true
+ class_option :update, :type => :boolean, :default => false,
+ :desc => "Just update public files, do not create a model"
+
def self.source_root
@_metrics_source_root ||= File.dirname(__FILE__)
end
+ def copy_public_files
+ directory "../../public", "public", :recursive => true
+ exit(0) if options.update?
+ end
+
def invoke_model
invoke "model", [name].concat(migration_columns),
- :timestamps => false, :test_framework => false, :migration => options.migration
+ :timestamps => false, :test_framework => false, :migration => options.migration?
end
def add_model_config
@@ -24,10 +32,6 @@ def add_application_config
CONTENT
end
- def copy_public_files
- directory "../../public", "public", :recursive => true
- end
-
protected
def migration_columns
@@ -1,3 +1,3 @@
module RailsMetrics
- VERSION = "0.0.1".freeze
+ VERSION = "0.1".freeze
end
@@ -5,7 +5,7 @@
Gem::Specification.new do |s|
s.name = %q{rails_metrics}
- s.version = "0.0.1"
+ s.version = "0.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Jos\303\251 Valim"]
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
"MIT-LICENSE",
"README.rdoc",
"Rakefile",
+ "TODO.rdoc",
"app/controllers/rails_metrics_controller.rb",
"app/helpers/rails_metrics_helper.rb",
"app/views/layouts/rails_metrics.html.erb",
@@ -31,6 +32,7 @@ Gem::Specification.new do |s|
"app/views/rails_metrics/index.html.erb",
"app/views/rails_metrics/show.html.erb",
"config/routes.rb",
+ "lib/generators/rails_metrics_generator.rb",
"lib/rails_metrics.rb",
"lib/rails_metrics/async_consumer.rb",
"lib/rails_metrics/engine.rb",
@@ -46,7 +48,7 @@ Gem::Specification.new do |s|
"public/images/rails_metrics/page_white_delete.png",
"public/images/rails_metrics/page_white_go.png",
"public/images/rails_metrics/tick.png",
- "public/javascripts/rails_metrics.js.js",
+ "public/javascripts/rails_metrics.js",
"public/javascripts/rails_metrics/g.pie-min.js",
"public/javascripts/rails_metrics/g.raphael-min.js",
"public/javascripts/rails_metrics/raphael-min.js",

0 comments on commit 4d3328f

Please sign in to comment.