summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2016-01-14 15:45:20 +0100
committerMagnus Ahltorp <map@kth.se>2016-01-14 15:45:20 +0100
commit24ba29ab998a9d454e5c7dfd11c59c97d0d920f5 (patch)
tree5fcbba68803f3ceb077f56bf5e895ad99d7b8035
parent7081864b2fcce8713b9441d388b3be617309426a (diff)
Make bench work again, add printing of total memorybenchfix
-rw-r--r--Makefile1
-rwxr-xr-xbench.erl8
-rw-r--r--test/src/db.erl5
3 files changed, 11 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index ce22d20..6bafe20 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,7 @@ build all:
cp c_src/fsynchelper c_src/hsmhelper c_src/permdbport priv/
mkdir -p test/ebin
(cd src && erlc -bber +der src/Dss.asn1 && rm Dss.beam)
+ (cd test/src && erlc -o ../ebin db.erl)
./make.erl
clean:
(cd c_src && make clean)
diff --git a/bench.erl b/bench.erl
index 9fa0651..bc5102d 100755
--- a/bench.erl
+++ b/bench.erl
@@ -2,6 +2,8 @@
%% -*- erlang -*-
%%! -pa test/ebin -pa ../lager/ebin -pa ../lager/deps/goldrush/ebin
+-mode(compile).
+
add_entries(Entries) ->
lists:foreach(fun (Entry) ->
ht:add(Entry)
@@ -17,9 +19,11 @@ timeprint(Time) ->
io_lib:format("~.2fs", [Time/1000000]).
printheapsize() ->
- case false of
+ case true of
true ->
- io:format("Heap size: local ~s ht ~s~n", [heapsize(self()), heapsize(ht)]);
+ Memory = erlang:memory(),
+ Total = proplists:get_value(total, Memory),
+ io:format("Heap size: local ~s ht ~s total ~.2f M~n", [heapsize(self()), heapsize(ht), Total/1024/1024]);
false ->
none
end.
diff --git a/test/src/db.erl b/test/src/db.erl
index 8c90842..a2ca16e 100644
--- a/test/src/db.erl
+++ b/test/src/db.erl
@@ -2,7 +2,10 @@
%%% See LICENSE for licensing information.
-module(db).
--export([get_by_indices/3]).
+-export([get_by_indices/3, size/0]).
+
+size() ->
+ 0.
get_by_indices(Start, _End, _Options) when Start < 0 ->
[];