diff options
author | Magnus Ahltorp <map@kth.se> | 2016-01-14 15:45:20 +0100 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2016-01-14 15:45:20 +0100 |
commit | 24ba29ab998a9d454e5c7dfd11c59c97d0d920f5 (patch) | |
tree | 5fcbba68803f3ceb077f56bf5e895ad99d7b8035 /bench.erl | |
parent | 7081864b2fcce8713b9441d388b3be617309426a (diff) |
Make bench work again, add printing of total memorybenchfix
Diffstat (limited to 'bench.erl')
-rwxr-xr-x | bench.erl | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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. |