Sha256: 4e0084a000d615bf8576aebfa36f9e60666eeccc9753a94b2a861b661c711866

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

module Speedos
  class Performance
    def self.test(name="")
      Log.info("#{name} Test begins")
      page = Page.new
      page.new_har

      yield page if block_given?

      Log.info("#{name} Test Complete")
      success = true
    rescue Exception => e
      Log.error("#{e}")
      Log.error("#{e.backtrace}")
      success = false
    ensure
      finialise_record(JSON.load(page.get_har.to_json)['log'], success)
      page.server_proxy.close
      page.server.stop
    end

    def finialise_record(log, success)
      record = Record.create(log: log, success: success)
      record.refresh_information
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
speedos-0.0.12 lib/speedos/performance.rb