Skip to content

Instantly share code, notes, and snippets.

@DriesS
Created August 17, 2011 16:55
Show Gist options
  • Save DriesS/1152005 to your computer and use it in GitHub Desktop.
Save DriesS/1152005 to your computer and use it in GitHub Desktop.
Problem vanity
module Vanity
module Adapters
class << self
# Creates new ActiveRecord connection and returns ActiveRecordAdapter.
def active_record_connection(spec)
require "active_record"
ActiveRecordAdapter.new(spec)
end
end
# ActiveRecord adapter
class ActiveRecordAdapter < AbstractAdapter
# Base model, stores connection and defines schema
class VanityRecord < ActiveRecord::Base
end
# Schema model
class VanitySchema < VanityRecord
set_table_name :vanity_schema
end
# Metric model
class VanityMetric < VanityRecord
set_table_name :vanity_metrics
has_many :vanity_metric_values
def self.retrieve(metric)
find_or_create_by_metric_id(metric.to_s)
end
end
# Metric value
class VanityMetricValue < VanityRecord
set_table_name :vanity_metric_values
belongs_to :vanity_metric
end
# Experiment model
class VanityExperiment < VanityRecord
set_table_name :vanity_experiments
has_many :vanity_conversions, :dependent => :destroy
# Finds or creates the experiment
def self.retrieve(experiment)
find_or_create_by_experiment_id(experiment.to_s)
end
def increment_conversion(alternative, count = 1)
record = vanity_conversions.find_or_create_by_alternative(alternative)
record.increment!(:conversions, count)
end
end
# Conversion model
class VanityConversion < VanityRecord
set_table_name :vanity_conversions
belongs_to :vanity_experiment
end
# Participant model
class VanityParticipant < VanityRecord
set_table_name :vanity_participants
# Finds the participant by experiment and identity. If
# create is true then it will create the participant
# if not found. If a hash is passed then this will be
# passed to create if creating, or will be used to
# update the found participant.
def self.retrieve(experiment, identity, create = true, update_with = nil)
if record = VanityParticipant.first(:conditions=>{ :experiment_id=>experiment.to_s, :identity=>identity.to_s })
record.update_attributes(update_with) if update_with
elsif create
record = VanityParticipant.create({ :experiment_id=>experiment.to_s, :identity=>identity }.merge(update_with || {}))
end
record
end
end
def initialize(options)
@options = options.inject({}) { |h,kv| h[kv.first.to_s] = kv.last ; h }
@options["adapter"] = @options["active_record_adapter"] if @options["active_record_adapter"]
VanityRecord.establish_connection(@options)
end
def active?
VanityRecord.connected?
end
def disconnect!
VanityRecord.connection.disconnect! if active?
end
def reconnect!
VanityRecord.connection.reconnect!
end
def flushdb
[VanityExperiment, VanityMetric, VanityParticipant, VanityMetricValue, VanityConversion].each do |klass|
klass.delete_all
end
end
def get_metric_last_update_at(metric)
record = VanityMetric.find_by_metric_id(metric.to_s)
record && record.updated_at
end
def metric_track(metric, timestamp, identity, values)
record = VanityMetric.retrieve(metric)
values.each_with_index do |value, index|
record.vanity_metric_values.create(:date => timestamp.to_date.to_s, :index => index, :value => value)
end
record.updated_at = Time.now
record.save
end
def metric_values(metric, from, to)
connection = VanityMetric.connection
record = VanityMetric.retrieve(metric)
dates = (from.to_date..to.to_date).map(&:to_s)
conditions = [connection.quote_column_name('date') + ' IN (?)', dates]
order = "#{connection.quote_column_name('date')}"
select = "sum(#{connection.quote_column_name('value')}) AS value, #{connection.quote_column_name('date')}"
group_by = "#{connection.quote_column_name('date')}"
values = record.vanity_metric_values.all(
:select => select,
:conditions => conditions,
:order => order,
:group => group_by
)
dates.map do |date|
value = values.detect{|v| v.date == date }
[(value && value.value) || 0]
end
end
def destroy_metric(metric)
record = VanityMetric.find_by_metric_id(metric.to_s)
record && record.destroy
end
# Store when experiment was created (do not write over existing value).
def set_experiment_created_at(experiment, time)
record = VanityExperiment.find_by_experiment_id(experiment.to_s) ||
VanityExperiment.new(:experiment_id => experiment.to_s)
record.created_at ||= time
record.save
end
# Return when experiment was created.
def get_experiment_created_at(experiment)
record = VanityExperiment.retrieve(experiment)
record && record.created_at
end
def set_experiment_completed_at(experiment, time)
VanityExperiment.retrieve(experiment).update_attribute(:completed_at, time)
end
def get_experiment_completed_at(experiment)
VanityExperiment.retrieve(experiment).completed_at
end
# Returns true if experiment completed.
def is_experiment_completed?(experiment)
!!VanityExperiment.retrieve(experiment).completed_at
end
# Returns counts for given A/B experiment and alternative (by index).
# Returns hash with values for the keys :participants, :converted and
# :conversions.
def ab_counts(experiment, alternative)
record = VanityExperiment.retrieve(experiment)
participants = VanityParticipant.count(:conditions => {:experiment_id => experiment.to_s, :seen => alternative})
converted = VanityParticipant.count(:conditions => {:experiment_id => experiment.to_s, :converted => alternative})
conversions = record.vanity_conversions.sum(:conversions, :conditions => {:alternative => alternative})
{
:participants => participants,
:converted => converted,
:conversions => conversions
}
end
# Pick particular alternative (by index) to show to this particular
# participant (by identity).
def ab_show(experiment, identity, alternative)
VanityParticipant.retrieve(experiment, identity, true, :shown => alternative)
end
# Indicates which alternative to show to this participant. See #ab_show.
def ab_showing(experiment, identity)
participant = VanityParticipant.retrieve(experiment, identity, false)
participant && participant.shown
end
# Cancels previously set association between identity and alternative. See
# #ab_show.
def ab_not_showing(experiment, identity)
VanityParticipant.retrieve(experiment, identity, true, :shown => nil)
end
# Records a participant in this experiment for the given alternative.
def ab_add_participant(experiment, alternative, identity)
VanityParticipant.retrieve(experiment, identity, true, :seen => alternative)
end
# Records a conversion in this experiment for the given alternative.
# Associates a value with the conversion (default to 1). If implicit is
# true, add particpant if not already recorded for this experiment. If
# implicit is false (default), only add conversion is participant
# previously recorded as participating in this experiment.
def ab_add_conversion(experiment, alternative, identity, count = 1, implicit = false)
VanityParticipant.retrieve(experiment, identity, implicit, :converted => alternative)
VanityExperiment.retrieve(experiment).increment_conversion(alternative, count)
end
# Returns the outcome of this experiment (if set), the index of a
# particular alternative.
def ab_get_outcome(experiment)
VanityExperiment.retrieve(experiment).outcome
end
# Sets the outcome of this experiment to a particular alternative.
def ab_set_outcome(experiment, alternative = 0)
VanityExperiment.retrieve(experiment).update_attribute(:outcome, alternative)
end
# Deletes all information about this experiment.
def destroy_experiment(experiment)
VanityParticipant.delete_all(:experiment_id => experiment.to_s)
record = VanityExperiment.find_by_experiment_id(experiment.to_s)
record && record.destroy
end
def to_s
@options.to_s
end
end
end
end
Showing /Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/templates/_ab_test.erb where line #1 raised:
Vanity::Adapters::ActiveRecordAdapter is not missing constant VanityConversion!
Extracted source (around line #1):
1: <% score = experiment.score %>
2: <table>
3: <caption>
4: <%= experiment.conclusion(score).join(" ") %></caption>
Trace of template inclusion: /Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/templates/_experiment.erb, /Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/templates/_experiments.erb, /Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/templates/_report.erb
RAILS_ROOT: /Users/dries/Sites/pouetstore
Application Trace | Framework Trace | Full Trace
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:417:in `load_missing_constant'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:96:in `const_missing'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:98:in `send'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:98:in `const_missing'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/base.rb:2197:in `compute_type'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/base.rb:2195:in `compute_type'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/reflection.rb:156:in `send'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/reflection.rb:156:in `klass'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/reflection.rb:187:in `quoted_table_name'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/associations/has_many_association.rb:97:in `construct_sql'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/associations/association_collection.rb:21:in `initialize'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/associations.rb:1300:in `new'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/associations.rb:1300:in `vanity_conversions'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/adapters/active_record_adapter.rb:243:in `ab_counts'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/experiment/ab_test.rb:142:in `_alternatives'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable.rb:77:in `each_with_index'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/experiment/ab_test.rb:141:in `each'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/experiment/ab_test.rb:141:in `each_with_index'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/experiment/ab_test.rb:141:in `_alternatives'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/experiment/ab_test.rb:276:in `alternatives'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/experiment/ab_test.rb:276:in `score'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/templates/_ab_test.erb:1:in `_run_erb_47Users47dries4746rvm47gems47ruby45146846745p30247gems47vanity45146546347lib47vanity47templates47_ab_test46erb_locals_experiment'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable.rb:34:in `send'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable.rb:34:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/base.rb:306:in `with_template'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable.rb:30:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable_partial.rb:20:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:26:in `benchmark'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dries/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:26:in `benchmark'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable_partial.rb:19:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/template.rb:205:in `render_template'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/base.rb:265:in `render_without_haml'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/haml-3.1.1/lib/haml/helpers/action_view_mods.rb:13:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/templates/_experiment.erb:3:in `_run_erb_47Users47dries4746rvm47gems47ruby45146846745p30247gems47vanity45146546347lib47vanity47templates47_experiment46erb_locals_experiment_id'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable.rb:34:in `send'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable.rb:34:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/base.rb:306:in `with_template'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable.rb:30:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable_partial.rb:20:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:26:in `benchmark'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dries/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:26:in `benchmark'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable_partial.rb:19:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/template.rb:205:in `render_template'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/base.rb:265:in `render_without_haml'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/haml-3.1.1/lib/haml/helpers/action_view_mods.rb:13:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/templates/_experiments.erb:4:in `_run_erb_47Users47dries4746rvm47gems47ruby45146846745p30247gems47vanity45146546347lib47vanity47templates47_experiments46erb_locals_experiments'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/templates/_experiments.erb:2:in `each'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/templates/_experiments.erb:2:in `_run_erb_47Users47dries4746rvm47gems47ruby45146846745p30247gems47vanity45146546347lib47vanity47templates47_experiments46erb_locals_experiments'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable.rb:34:in `send'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable.rb:34:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/base.rb:306:in `with_template'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable.rb:30:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable_partial.rb:20:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:26:in `benchmark'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dries/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:26:in `benchmark'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable_partial.rb:19:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/template.rb:205:in `render_template'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/base.rb:265:in `render_without_haml'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/haml-3.1.1/lib/haml/helpers/action_view_mods.rb:13:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/templates/_report.erb:18:in `_run_erb_47Users47dries4746rvm47gems47ruby45146846745p30247gems47vanity45146546347lib47vanity47templates47_report46erb'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable.rb:34:in `send'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable.rb:34:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/base.rb:306:in `with_template'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable.rb:30:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable_partial.rb:20:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:26:in `benchmark'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dries/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:26:in `benchmark'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/renderable_partial.rb:19:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/template.rb:205:in `render_template'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_view/base.rb:265:in `render_without_haml'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/haml-3.1.1/lib/haml/helpers/action_view_mods.rb:13:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/base.rb:1250:in `render_for_file'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/base.rb:942:in `render_without_benchmark'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:51:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dries/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:51:in `render'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/frameworks/rails.rb:181:in `index'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `send'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `perform_action_without_filters'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:in `call_filters'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/filters.rb:638:in `run_before_filters'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/frameworks/rails.rb:70:in `vanity_context_filter'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in `send'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in `evaluate_method'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/filters.rb:186:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/filters.rb:635:in `run_before_filters'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/filters.rb:615:in `call_filters'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dries/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:in `perform_action'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `send'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `process_without_filters'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in `process_without_compass'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/compass-0.11.1/lib/compass/app_integration/rails/actionpack2/action_controller.rb:7:in `process'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:in `process'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in `dispatch'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in `_call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/sass-3.1.1/lib/sass/plugin/rack.rb:54:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in `call'
vendor/plugins/bentostore/app/middleware/flash_session_cookie_middleware.rb:14:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/hoptoad_notifier-2.4.9/lib/hoptoad_notifier/rack.rb:27:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/hoptoad_notifier-2.4.9/lib/hoptoad_notifier/user_informer.rb:12:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:106:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rack-1.0.1/lib/rack/chunked.rb:15:in `call'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:64:in `process'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:165:in `process_client'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:164:in `each'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:164:in `process_client'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:291:in `run'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:291:in `initialize'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:291:in `new'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:291:in `run'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:274:in `initialize'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:274:in `new'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:274:in `run'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:34:in `run'
/Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/commands/server.rb:111
/Users/dries/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Users/dries/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
script/server:3
ab_test "Price options" do
description "Mirror, mirror on the wall, who's the better price of all?"
alternatives 19, 25, 29
metrics :signups
end
metric :signups do
description 'new metric description'
model User
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment