網頁

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.


  class PurchasesController < ApplicationController
    def create

      ActiveRecord::Base.transaction do
        # This do purchase
        raise ActiveRecord::Rollback if params[:dryrun] # when dryrun then rollback.
      end

    end
  end

沒有留言: