Permalink
Browse files

Carry out a benchmark.

  • Loading branch information...
1 parent bf74541 commit b398de61f896e50fcb0ea9dc7d916405f6069086 @jlouis committed Dec 25, 2012
Showing with 32 additions and 14 deletions.
  1. +8 −0 plot.R
  2. +1 −1 src/sv_codel.erl
  3. +23 −13 test/sv_SUITE.erl
View
8 plot.R
@@ -0,0 +1,8 @@
+library(ggplot2)
+
+x <- read.csv("trace.out", header=TRUE)
+z <- ggplot(x, aes(Time, QSize, color=Sojourn))
+
+pdf("dequeueing.pdf")
+z + geom_point()
+dev.off()
View
@@ -73,7 +73,7 @@ qstate(#state {
%% Queue API
%% -----------------------------
new() ->
- init(5*1000, 100*1000).
+ init(50*1000, 500*1000).
len(#state { queue = Q }) -> ?Q:len(Q).
View
@@ -72,24 +72,34 @@ through(_Config) ->
many_through_ets(_Config) ->
Parent = self(),
- Pids = [spawn_link(fun() ->
- case sv:run(test_queue_1_ets, fun work/0) of
- {ok, ok} -> Parent ! {done, self()};
- {error, overload} -> Parent ! {overload, self()}
- end
- end) || _ <- lists:seq(1, 60)],
+ Pids = [
+ begin
+ Pid = spawn_link(fun() ->
+ case sv:run(test_queue_1_ets, fun work/0) of
+ {ok, ok} -> Parent ! {done, self()};
+ {error, overload} -> Parent ! {overload, self()}
+ end
+ end),
+ timer:sleep(20),
+ Pid
+ end || _ <- lists:seq(1, 60)],
{ok, Overloads} = collect(Pids, 0),
ct:log("Overloads: ~B", [Overloads]),
true = Overloads == 0.
many_through_codel(_Config) ->
Parent = self(),
- Pids = [spawn_link(fun() ->
- case sv:run(test_queue_1_codel, fun work/0) of
- {ok, ok} -> Parent ! {done, self()};
- {error, overload} -> Parent ! {overload, self()}
- end
- end) || _ <- lists:seq(1, 60)],
+ Pids = [
+ begin
+ Pid = spawn_link(fun() ->
+ case sv:run(test_queue_1_codel, fun work/0) of
+ {ok, ok} -> Parent ! {done, self()};
+ {error, overload} -> Parent ! {overload, self()}
+ end
+ end),
+ timer:sleep(20),
+ Pid
+ end || _ <- lists:seq(1, 60)],
{ok, Overloads} = collect(Pids, 0),
ct:log("Overloads: ~B", [Overloads]),
true = Overloads > 0.
@@ -104,7 +114,7 @@ collect(Pids, Overloads) when is_list(Pids) ->
{overload, Pid} ->
collect(Pids -- [Pid], Overloads + 1)
after 5000 ->
- {error, timeout}
+ {error, {timeout, Pids, Overloads}}
end.

0 comments on commit b398de6

Please sign in to comment.