summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_db.erl
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2009-05-24 00:04:36 +0000
committerDamien F. Katz <damien@apache.org>2009-05-24 00:04:36 +0000
commit4aac0f7c6dcd3f3a29cfe5e1bf2bee84b9bae9d5 (patch)
treeda508e7b1ab785f409fc670ade1d94f114264469 /src/couchdb/couch_httpd_db.erl
parentb5da838ae062ddddba44e1c9d830435d22d8040b (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_httpd_db.erl')
-rw-r--r--src/couchdb/couch_httpd_db.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index 04f178d5..03cba11e 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -51,18 +51,21 @@ handle_changes_req(#httpd{method='GET',path_parts=[DbName|_]}=Req, Db) ->
case couch_httpd:qs_value(Req, "continuous", "false") of
"true" ->
Self = self(),
- Notify = couch_db_update_notifier:start_link(
+ {ok, Notify} = couch_db_update_notifier:start_link(
fun({_, DbName0}) when DbName0 == DbName ->
Self ! db_updated;
(_) ->
ok
end),
+ couch_stats_collector:track_process_count(Self,
+ {httpd, clients_requesting_changes}),
try
keep_sending_changes(Req, Resp, Db, StartSeq, <<"">>)
after
- catch couch_db_update_notifier:stop(Notify),
+ couch_db_update_notifier:stop(Notify),
wait_db_updated(0) % clean out any remaining update messages
end;
+
"false" ->
{ok, {LastSeq, _Prepend}} =
send_changes(Req, Resp, Db, StartSeq, <<"">>),