diff options
author | Damien F. Katz <damien@apache.org> | 2009-05-24 00:04:36 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2009-05-24 00:04:36 +0000 |
commit | 4aac0f7c6dcd3f3a29cfe5e1bf2bee84b9bae9d5 (patch) | |
tree | da508e7b1ab785f409fc670ade1d94f114264469 /src/couchdb/couch_stats_collector.erl | |
parent | b5da838ae062ddddba44e1c9d830435d22d8040b (diff) |
Added stats tracking for active _changes clients.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@778072 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_stats_collector.erl')
-rw-r--r-- | src/couchdb/couch_stats_collector.erl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/couchdb/couch_stats_collector.erl b/src/couchdb/couch_stats_collector.erl index ad5e9e9a..9139f6cb 100644 --- a/src/couchdb/couch_stats_collector.erl +++ b/src/couchdb/couch_stats_collector.erl @@ -24,7 +24,7 @@ -export([start/0, stop/0, get/1, increment/1, decrement/1, - track_process_count/1, + track_process_count/1, track_process_count/2, record/2, clear/1, all/0, all/1]). @@ -87,14 +87,15 @@ all(Type) -> absolute -> ets:tab2list(?ABSOLUTE_VALUE_COUNTER_TABLE) end. - track_process_count(Stat) -> + track_process_count(self(), Stat). + +track_process_count(Pid, Stat) -> case (catch couch_stats_collector:increment(Stat)) of ok -> - Self = self(), spawn( fun() -> - erlang:monitor(process, Self), + erlang:monitor(process, Pid), receive {'DOWN', _, _, _, _} -> ok end, couch_stats_collector:decrement(Stat) end); |