Browse files

Past: passenger pane

  • Loading branch information...
ReinH committed Apr 27, 2009
1 parent b403878 commit a8929d90431cfe6fc780176d3c7ade2cb4d3cc46
@@ -2,6 +2,7 @@
title: Simplify Your Dev Environment With Passenger Pane
created_at: 2009-04-17 10:04:11.318707 -04:00
layout: post
+summary: Wherein our hero describes the installation of Passenger Pane and the awesomeness that therein ensues.
- erb
- markdown
@@ -0,0 +1,50 @@
+title: Custom FiveRuns TuneUp Instrumentation
+created_at: 2009-04-21 11:30:23.317961 -04:00
+layout: post
+summary: Wherein our hero describes the setup of custom instrumentation for FiveRuns TuneUp reporting
+ - erb
+ - textile
+<% @page[:excerpt] = capture_erb do %>
+!http://<%= %>/images/product_tuneup.gif!
+"TuneUp": is a development performance monitoring tool from "FiveRuns": It can help you catch poorly performing actions and queries early and is a great tool to add to your performance monitoring toolbelt. TuneUp also makes it very simple to add custom instrumentation to your Rails app, which came in handy when we needed to report on web service queries made by our Endeca client.
+<% end %>
+<%= @page.excerpt %>
+A brief chat with "Bruce Williams": helped point the way to TuneUp's @FiveRuns::TuneUp.step@, the jumping-off point for its instrumentation of your model, view and controller activity. We were able to write a simple plugin that adds instrumentation to calls made by the "Primedia Endeca gem": (a gem used to consume Endeca's RESTful JSON bridge API).
+The plugin takes advantage of @alias_method_chain@ to add instrumentation to the Endeca query methods. This solution is very clean and is idiomatic to Rails itself as Rails uses @alias_method_chain@ to "embellish" many parts of the request response cycle for things like benchmarking and caching, as "David mentions": in a blog post from his Rails Myths series
+If you want to look at the code, you can find the plugin at its "github repo": All the code is in the "@init.rb@": but I'll reprint it here for convenience. Note that we could have refactored these similar method definitions using metaprogramming techniques but chose not to do so for reasons of simplicity and clarity.
+<% coderay(:lang => "ruby") do -%>
+if defined? FiveRuns && defined? Endeca && defined? Endeca::Document
+ # Tuneup instrumentation
+ class << Endeca::Document
+ def all_with_tuneup(*args)
+ Fiveruns::Tuneup.step "#{name}.all", :model do
+ all_without_tuneup(*args)
+ end
+ end
+ alias_method_chain :all, :tuneup
+ def first_with_tuneup(*args)
+ Fiveruns::Tuneup.step "#{name}.first", :model do
+ first_without_tuneup(*args)
+ end
+ end
+ alias_method_chain :first, :tuneup
+ def by_id_with_tuneup(*args)
+ Fiveruns::Tuneup.step "#{name}.by_id", :model do
+ by_id_without_tuneup(*args)
+ end
+ end
+ alias_method_chain :by_id, :tuneup
+ end
+<% end %>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -1,4 +1,3 @@
require 'rake/contrib/sshpublisher'
task :staging do
@@ -12,8 +11,9 @@ end
namespace :deploy do
SITE.user = "www" = ""
- # SITE.remote_dir = "/var/www/"
SITE.remote_dir = "/var/www/"
+ # = ""
+ # SITE.remote_dir = "/var/www/"
SITE.rsync_args = %w( -av --delete )
desc 'Deploy to the server using rsync'
@@ -30,6 +30,4 @@ namespace :deploy do
-end # deploy
-# EOF

0 comments on commit a8929d9

Please sign in to comment.