Really disable stats.

This commit is contained in:
Gregory Burd 2013-07-30 14:34:04 -04:00
parent 211ffd884c
commit 2393257bef

View file

@ -340,23 +340,26 @@ is_empty(#state{connection=Connection, table=Table}) ->
%% @doc Get the status information for this wterl backend %% @doc Get the status information for this wterl backend
-spec status(state()) -> [{atom(), term()}]. -spec status(state()) -> [{atom(), term()}].
status(#state{connection=Connection, table=Table}) -> status(_) ->
case wterl:cursor_open(Connection, Table) of [].
{ok, Cursor} ->
TheStats = %% status(#state{connection=Connection, table=Table}) ->
case fetch_status(Cursor) of %% case wterl:cursor_open(Connection, Table) of
{ok, Stats} -> %% {ok, Cursor} ->
Stats; %% TheStats =
{error, {eperm, _}} -> % TODO: review/fix this logic %% case fetch_status(Cursor) of
{ok, []}; %% {ok, Stats} ->
_ -> %% Stats;
{ok, []} %% {error, {eperm, _}} -> % TODO: review/fix this logic
end, %% {ok, []};
wterl:cursor_close(Cursor), %% _ ->
TheStats; %% {ok, []}
{error, Reason2} -> %% end,
{error, Reason2} %% wterl:cursor_close(Cursor),
end. %% TheStats;
%% {error, Reason2} ->
%% {error, Reason2}
%% end.
%% @doc Register an asynchronous callback %% @doc Register an asynchronous callback
-spec callback(reference(), any(), state()) -> {ok, state()}. -spec callback(reference(), any(), state()) -> {ok, state()}.
@ -543,8 +546,7 @@ from_index_key(LKey) ->
%% @private %% @private
%% Return all status from wterl statistics cursor %% Return all status from wterl statistics cursor
fetch_status(_Cursor) -> %% fetch_status(Cursor) ->
{ok, []}.
%% {ok, fetch_status(Cursor, wterl:cursor_next_value(Cursor), [])}. %% {ok, fetch_status(Cursor, wterl:cursor_next_value(Cursor), [])}.
%% fetch_status(_Cursor, {error, _}, Acc) -> %% fetch_status(_Cursor, {error, _}, Acc) ->
%% lists:reverse(Acc); %% lists:reverse(Acc);