Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A/B Testing with Metriks

A/B Testing with Metriks

Quick lightning talk about using metriks to run a dead simple performance A/B test.

Larry Marburger

October 01, 2012
Tweet

More Decks by Larry Marburger

Other Decks in Programming

Transcript

  1. Lazy Metrics <script>var start = new Date();</script> <img src="<%= content_url

    %>"> <script> $('img').load(function() { recordMetric("image-load", new Date() - start); }); </script> Monday, October 1, 12
  2. Lazy Metrics <script>var start = new Date();</script> <img src="<%= content_url

    %>"> <script> $('img').load(function() { recordMetric("image-load", new Date() - start); }); </script> Monday, October 1, 12
  3. Lazy Metrics <script>var start = new Date();</script> <img src="<%= content_url

    %>"> <script> $('img').load(function() { recordMetric("image-load", new Date() - start); }); </script> Monday, October 1, 12
  4. Server # /metrics?name=image-load&value=123.45 get '/metrics' do name = params['name'] value

    = params['value'] Metriks.timer(name).update(value) content_type 'text/javascript' status 200 end Monday, October 1, 12
  5. Server # /metrics?name=image-load&value=123.45 get '/metrics' do name = params['name'] value

    = params['value'] Metriks.timer(name).update(value) content_type 'text/javascript' status 200 end Monday, October 1, 12
  6. Server # /metrics?name=image-load&value=123.45 get '/metrics' do name = params['name'] value

    = params['value'] Metriks.timer(name).update(value) content_type 'text/javascript' status 200 end Monday, October 1, 12
  7. Lazy A/B Test <% if fast = [true, false].sample %>

    <img src="<%= fast_content_url %>"> <% else %> <img src="<%= content_url %>"> <% end %> Monday, October 1, 12
  8. Lazy A/B Test <script> $('img').load(function() { name = "image-load<%= fast

    ? '-test' : '' %>" recordMetric(name, new Date() - start); }); </script> Monday, October 1, 12
  9. Lazy A/B Test <script> $('img').load(function() { name = "image-load<%= fast

    ? '-test' : '' %>" recordMetric(name, new Date() - start); }); </script> Monday, October 1, 12