網頁

2016年7月14日 星期四

Test transaction page performance

Usually we test web page performance. Maybe test 1000 with 5 concorrent.
If we test a transaction page performance. Will left many ugly transaction data.
So we can desgin a dryrun mode. below is ruby on rails sample.


  1. <pre>  class PurchasesController < ApplicationController
  2.     def create
  3.       ActiveRecord::Base.transaction do
  4.         # This do purchase
  5.         raise ActiveRecord::Rollback if params[:dryrun] # when dryrun then rollback.
  6.       end
  7.     end
  8.   end
  9. </pre>

沒有留言: