This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
2020-02-04 02:06:13 +01:00
|
|
|
require "benchmark"
|
|
|
|
require "ipc"
|
|
|
|
require "../test-ws"
|
|
|
|
|
|
|
|
ws_uri = "ws://localhost:1234/pong.JSON"
|
|
|
|
|
|
|
|
message = IPC::Message.from_json(%({ "mtype" : 3, "utype" : 30, "payload" : "coucou" }))
|
|
|
|
|
|
|
|
Benchmark.ips do |bm|
|
|
|
|
bm.report("connection") do
|
2020-08-24 19:58:43 +02:00
|
|
|
c = IPC::Client.new "pong"
|
|
|
|
c.close
|
2020-02-04 02:06:13 +01:00
|
|
|
end
|
|
|
|
|
2020-08-24 19:58:43 +02:00
|
|
|
bm.report("connection through websocket") do
|
|
|
|
tws = TestWS.new ws_uri
|
|
|
|
end
|
|
|
|
end
|