1. Dec 4th, 2009

    Vanity 1.1.0: Metrics and Ruby 1.8.6/7 support

    This release introduces metrics.  Metrics are the gateway drug to better software.

    A metric definition is a Ruby file that looks like this:

    metric "Signup" do
      description "Measures how many people signed up for our awesome service."
    end

    Once you have your metric, feed it data by calling the track! method. For example:

    class AccountsController < ApplicationController
    
      def create
        @person = Person.new(params[:person])
        if @person.save
          track! :signup      # track successful sign up
          UserSession.create person
          redirect_to root_url
        else
          render :action=>:new
        end
      end
    
    end

    Define, track, that’s about all you need to know.

    Metric data can also come from database queries, log files, Google Analytics, etc. To use external sources you have to write your own metric implementation.

    Read more about metrics.

    You want to start using metrics from your A/B tests, for example:

    ab_test "Pricing options" do
      metrics :signup
      alternatives 15, 25, 29
    end
    

    You’ll see why this is a good idea soon enough.

    Much thanks to Ian Sefferman for finding bugs and helping fix Ruby 1.8.7 and Rails support.

    Keep measuring and experimenting,
    Assaf

    Your comment, here ⇓