Sha256: 5a39fd60ff9b32215a0155c58a6a32937ccf842c7b51ef43807c7b892b8b5af0

Contents?: true

Size: 761 Bytes

Versions: 17

Compression:

Stored size: 761 Bytes

Contents

#!/usr/bin/env ruby

require "cloudstack_client/api"
require "benchmark"
require "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(
  JSON.generate(
    {
      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

17 entries across 17 versions & 1 rubygems

Version Path
cloudstack_client-1.5.10 test/benchmark.rb
cloudstack_client-1.5.9 test/benchmark.rb
cloudstack_client-1.5.8 test/benchmark.rb
cloudstack_client-1.5.7 test/benchmark.rb
cloudstack_client-1.5.6 test/benchmark.rb
cloudstack_client-1.5.5 test/benchmark.rb
cloudstack_client-1.5.4 test/benchmark.rb
cloudstack_client-1.5.3 test/benchmark.rb
cloudstack_client-1.5.2 test/benchmark.rb
cloudstack_client-1.5.1 test/benchmark.rb
cloudstack_client-1.5.0 test/benchmark.rb
cloudstack_client-1.4.3 test/benchmark.rb
cloudstack_client-1.4.2 test/benchmark.rb
cloudstack_client-1.4.1 test/benchmark.rb
cloudstack_client-1.4.0 test/benchmark.rb
cloudstack_client-1.3.1 test/benchmark.rb
cloudstack_client-1.3.0 test/benchmark.rb