summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ts.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ts.erl b/src/ts.erl
index 8ea4895..345ed66 100644
--- a/src/ts.erl
+++ b/src/ts.erl
@@ -2,7 +2,7 @@
-module(ts).
-include_lib("eunit/include/eunit.hrl").
-export_type([tree_store/0]).
--export([new/0, delete/1, store/3, retrieve/2, retrieve_hash/2]).
+-export([new/0, delete/1, size/1, store/3, retrieve/2, retrieve_hash/2]).
%% -record(tree_store, {warm :: ets:tid(),
%% frozen :: list()}). % [ets:tid()]
@@ -15,7 +15,10 @@ new() ->
#tree_store{table = ets:new(nil, [{read_concurrency, true}])}.
delete(Store) ->
- ets:delete(Store#tree_store.table).
+ ets:delete(Store#tree_store.table).
+
+size(Store) ->
+ ets:info(Store#tree_store.table, size).
-spec store(tree_store(), tuple(), binary()) -> tree_store().
store(Store, IR, Hash) ->