summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_stats_collector.erl
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2009-04-09 21:37:23 +0000
committerDamien F. Katz <damien@apache.org>2009-04-09 21:37:23 +0000
commitcdf43ab5a1d5ea21e42302c848fe4f07150e6947 (patch)
tree431279b218c6bb13454dcfc73286b45c1f9a690d /src/couchdb/couch_stats_collector.erl
parentcf3eac0fc97cc4671c1ba86e1924b0a46d096333 (diff)
Fix for attachment sparseness bug COUCHDB-220 by giving each attachment it's own stream and calling set_min_buffer instead of ensure_buffer. Also fixed spurious couch_file crash messages by putting the statistics decrement code into a seperate monitoring process.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@763816 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_stats_collector.erl')
-rw-r--r--src/couchdb/couch_stats_collector.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/couchdb/couch_stats_collector.erl b/src/couchdb/couch_stats_collector.erl
index 8d0234bb..854fffb0 100644
--- a/src/couchdb/couch_stats_collector.erl
+++ b/src/couchdb/couch_stats_collector.erl
@@ -56,13 +56,17 @@ increment({Module, Key}) when is_integer(Key) ->
increment({Module, list_to_atom(integer_to_list(Key))});
increment(Key) ->
case catch ets:update_counter(?HIT_COUNTER_TABLE, Key, 1) of
- {'EXIT', {badarg, _}} -> ets:insert(?HIT_COUNTER_TABLE, {Key, 1});
+ {'EXIT', {badarg, _}} ->
+ true = ets:insert(?HIT_COUNTER_TABLE, {Key, 1}),
+ ok;
_ -> ok
end.
decrement(Key) ->
case catch ets:update_counter(?HIT_COUNTER_TABLE, Key, -1) of
- {'EXIT', {badarg, _}} -> ets:insert(?HIT_COUNTER_TABLE, {Key, -1});
+ {'EXIT', {badarg, _}} ->
+ true = ets:insert(?HIT_COUNTER_TABLE, {Key, -1}),
+ ok;
_ -> ok
end.