Sha256: 9cb6779ab2a8e6c65f7054bc2b1667ce447482678b1e3ddf29fdb1f7ca4f3f34

Contents?: true

Size: 768 Bytes

Versions: 4

Compression:

Stored size: 768 Bytes

Contents

#!/usr/bin/env ruby

require "cloudstack_client/api"
require "benchmark"
require "multi_json"

GC.disable

memory_before = `ps -o rss= -p #{Process.pid}`.to_i/1024
gc_stat_before = GC.stat

time = Benchmark.realtime do
  100.times do
    api = CloudstackClient::Api.new
    command = "listVirtualMachines"
    api.command_supports_param?(command, "id")
    api.required_params(command)
    api.all_required_params?("deployVirtualMachine", { name: "test", templateid: 1 })
  end
end

gc_stat_after = GC.stat
memory_after = `ps -o rss= -p #{Process.pid}`.to_i/1024

puts(
  MultiJson.dump(
    {
      time: time.round(2),
      gc_count: gc_stat_after[:count] - gc_stat_before[:count],
      memory: "%dM" % (memory_after - memory_before)
    },
    pretty: true
  )
)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cloudstack_client-1.2.3 test/benchmark.rb
cloudstack_client-1.2.2 test/benchmark.rb
cloudstack_client-1.2.1 test/benchmark.rb
cloudstack_client-1.2.0 test/benchmark.rb