Skip to content
Newer
Older
100755 29 lines (23 sloc) 940 Bytes
6816253 @yrashk Added some draft throughput perf tests
yrashk authored Feb 17, 2011
1 #! /usr/bin/env escript
920c628 @evax Fix perf tests
evax authored Mar 2, 2011
2 %%! -smp enable -pa ebin -pa perf
3 %-mode(compile).
6816253 @yrashk Added some draft throughput perf tests
yrashk authored Feb 17, 2011
4
364d1d9 @evax Revert unmotivated {remote,local}_thr perf tests changes
evax authored Feb 18, 2011
5 main([BindTo,MessageSizeStr,MessageCountStr]) ->
6816253 @yrashk Added some draft throughput perf tests
yrashk authored Feb 17, 2011
6 {MessageSize, _} = string:to_integer(MessageSizeStr),
7 {MessageCount, _} = string:to_integer(MessageCountStr),
8 {ok, Context} = ezmq:context(),
9 {ok, Socket} = ezmq:socket(Context, sub),
10 ok = ezmq:setsockopt(Socket,subscribe, <<>>),
364d1d9 @evax Revert unmotivated {remote,local}_thr perf tests changes
evax authored Feb 18, 2011
11 ok = ezmq:bind(Socket, BindTo),
920c628 @evax Fix perf tests
evax authored Mar 2, 2011
12 ezmq:recv(Socket),
13 Start = now(),
14 ezmq_perf:recv_loop(MessageCount-1, Socket),
15 Elapsed = timer:now_diff(now(), Start),
16
364d1d9 @evax Revert unmotivated {remote,local}_thr perf tests changes
evax authored Feb 18, 2011
17 Throughput = MessageCount / Elapsed * 1000000,
acee730 @evax Fix Mb/s computation in local_thr perf test
evax authored Feb 18, 2011
18 Megabits = Throughput * MessageSize * 8 / 1000000,
6816253 @yrashk Added some draft throughput perf tests
yrashk authored Feb 17, 2011
19
20 io:format("message size: ~p [B]~n"
21 "message count: ~p~n"
22 "mean throughput: ~p [msg/s]~n"
364d1d9 @evax Revert unmotivated {remote,local}_thr perf tests changes
evax authored Feb 18, 2011
23 "mean throughput: ~p [Mb/s]~n",
307d4ee @yrashk Added ezmq:close/1 and ezmq:term/1 functions as GC cleanup magic was …
yrashk authored Mar 3, 2011
24 [MessageSize, MessageCount, Throughput, Megabits]),
25
26 ezmq:close(Socket),
27 ezmq:term(Context).
920c628 @evax Fix perf tests
evax authored Mar 2, 2011
28
Something went wrong with that request. Please try again.