Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 29 lines (23 sloc) 0.975 kb
6816253 @yrashk Added some draft throughput perf tests
yrashk authored
1 #! /usr/bin/env escript
920c628 @evax Fix perf tests
evax authored
2 %%! -smp enable -pa ebin -pa perf
3 %-mode(compile).
6816253 @yrashk Added some draft throughput perf tests
yrashk authored
4
364d1d9 @evax Revert unmotivated {remote,local}_thr perf tests changes
evax authored
5 main([BindTo,MessageSizeStr,MessageCountStr]) ->
6816253 @yrashk Added some draft throughput perf tests
yrashk authored
6 {MessageSize, _} = string:to_integer(MessageSizeStr),
7 {MessageCount, _} = string:to_integer(MessageCountStr),
baa8345 @yrashk Renamed ezmq to erlzmq2
yrashk authored
8 {ok, Context} = erlzmq:context(),
fa6cb33 @okeuday Add active receive with eunit tests. NIF code cleanup.
okeuday authored
9 {ok, Socket} = erlzmq:socket(Context, [sub, {active, false}]),
baa8345 @yrashk Renamed ezmq to erlzmq2
yrashk authored
10 ok = erlzmq:setsockopt(Socket,subscribe, <<>>),
11 ok = erlzmq:bind(Socket, BindTo),
12 erlzmq:recv(Socket),
920c628 @evax Fix perf tests
evax authored
13 Start = now(),
baa8345 @yrashk Renamed ezmq to erlzmq2
yrashk authored
14 erlzmq_perf:recv_loop(MessageCount-1, Socket),
920c628 @evax Fix perf tests
evax authored
15 Elapsed = timer:now_diff(now(), Start),
16
364d1d9 @evax Revert unmotivated {remote,local}_thr perf tests changes
evax authored
17 Throughput = MessageCount / Elapsed * 1000000,
acee730 @evax Fix Mb/s computation in local_thr perf test
evax authored
18 Megabits = Throughput * MessageSize * 8 / 1000000,
6816253 @yrashk Added some draft throughput perf tests
yrashk authored
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
23 "mean throughput: ~p [Mb/s]~n",
307d4ee @yrashk Added ezmq:close/1 and ezmq:term/1 functions as GC cleanup magic was oft...
yrashk authored
24 [MessageSize, MessageCount, Throughput, Megabits]),
25
baa8345 @yrashk Renamed ezmq to erlzmq2
yrashk authored
26 erlzmq:close(Socket),
27 erlzmq:term(Context).
920c628 @evax Fix perf tests
evax authored
28
Something went wrong with that request. Please try again.