Skip to content
Newer
Older
100755 25 lines (19 sloc) 844 Bytes
d712845 @evax Add {remote,local}_lat perf tests
evax authored
1 #! /usr/bin/env escript
0139502 @evax Update perf tests to support active mode
evax authored
2 %%! -smp enable -pa ebin -pa perf
d712845 @evax Add {remote,local}_lat perf tests
evax authored
3
4 main([ConnectTo,MessageSizeStr,RoundtripCountStr]) ->
5 {MessageSize, _} = string:to_integer(MessageSizeStr),
6 {RoundtripCount, _} = string:to_integer(RoundtripCountStr),
baa8345 @yrashk Renamed ezmq to erlzmq2
yrashk authored
7 {ok, Context} = erlzmq:context(),
fa6cb33 @okeuday Add active receive with eunit tests. NIF code cleanup.
okeuday authored
8 {ok, Socket} = erlzmq:socket(Context, [req, {active, false}]),
baa8345 @yrashk Renamed ezmq to erlzmq2
yrashk authored
9 ok = erlzmq:connect(Socket, ConnectTo),
d712845 @evax Add {remote,local}_lat perf tests
evax authored
10 Msg = list_to_binary(lists:duplicate(MessageSize, 0)),
11
0139502 @evax Update perf tests to support active mode
evax authored
12 Start = now(),
13 erlzmq_perf:remote_lat_loop(RoundtripCount, Socket, Msg),
14 Elapsed = timer:now_diff(now(), Start),
d712845 @evax Add {remote,local}_lat perf tests
evax authored
15
16 Latency = Elapsed / (RoundtripCount * 2),
17
18 io:format("message size: ~p [B]~n"
19 "roundtrip count: ~p~n"
20 "average latency: ~p [us]~n",
307d4ee @yrashk Added ezmq:close/1 and ezmq:term/1 functions as GC cleanup magic was …
yrashk authored
21 [MessageSize, RoundtripCount, Latency]),
baa8345 @yrashk Renamed ezmq to erlzmq2
yrashk authored
22 erlzmq:close(Socket),
23 erlzmq:term(Context).
0139502 @evax Update perf tests to support active mode
evax authored
24
Something went wrong with that request. Please try again.