Sha256: ef225e195ca050a71a9d7f5cbf216af120b35553fb6f32fdc92afa8878faa77b

Contents?: true

Size: 882 Bytes

Versions: 39

Compression:

Stored size: 882 Bytes

Contents

ENV["PB_CLIENT_TYPE"] = "protobuf/nats/client"
ENV["PB_SERVER_TYPE"] = "protobuf/nats/runner"

require "benchmark/ips"
require "./examples/warehouse/app"

payload = ::Warehouse::Shipment.new(:guid => ::SecureRandom.uuid, :address => "123 yolo st")
request = ::Protobuf::Socketrpc::Request.new(:service_name => "::Warehouse::ShipmentService",
                                             :method_name => "create",
                                             :request_proto => payload.encode).encode

nats = ::NATS::IO::Client.new
nats.connect({:servers => ["nats://127.0.0.1:4222"]})

subscription_key_and_queue = "rpc.warehouse.shipment_service.create"

Protobuf::Logging.logger = ::Logger.new(nil)

Benchmark.ips do |config|
  config.warmup = 10
  config.time = 10

  config.report("single threaded performance") do
    nats.request(subscription_key_and_queue, request)
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
protobuf-nats-0.10.8 bench/client.rb
protobuf-nats-0.10.7 bench/client.rb
protobuf-nats-0.10.6 bench/client.rb
protobuf-nats-0.10.5 bench/client.rb
protobuf-nats-0.12.0.pre0 bench/client.rb
protobuf-nats-0.10.4 bench/client.rb
protobuf-nats-0.10.3 bench/client.rb
protobuf-nats-0.10.3.pre0 bench/client.rb
protobuf-nats-0.10.2 bench/client.rb
protobuf-nats-0.11.0.pre1 bench/client.rb
protobuf-nats-0.11.0.pre0 bench/client.rb
protobuf-nats-0.10.1 bench/client.rb
protobuf-nats-0.10.0 bench/client.rb
protobuf-nats-0.9.0 bench/client.rb
protobuf-nats-0.9.0.pre3 bench/client.rb
protobuf-nats-0.9.0.pre2 bench/client.rb
protobuf-nats-0.9.0.pre1 bench/client.rb
protobuf-nats-0.8.0 bench/client.rb
protobuf-nats-0.7.0 bench/client.rb
protobuf-nats-0.7.0.pre1 bench/client.rb