You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/08/28 13:59:33 UTC

[10/50] chttpd commit: updated refs/heads/master to 58020ab

Add _reload_query_servers, report stale proc count

BugzID: 19529


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/12ea8a31
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/12ea8a31
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/12ea8a31

Branch: refs/heads/master
Commit: 12ea8a313352567917bfbc2a1209904c1b9a88e2
Parents: 204ab91
Author: Adam Kocoloski <ad...@cloudant.com>
Authored: Thu Jun 6 12:13:00 2013 -0400
Committer: Robert Newson <rn...@apache.org>
Committed: Tue Jul 29 18:01:43 2014 +0100

----------------------------------------------------------------------
 src/chttpd.erl      |  1 +
 src/chttpd_misc.erl | 31 ++++++++++++++++++++++++-------
 2 files changed, 25 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/12ea8a31/src/chttpd.erl
----------------------------------------------------------------------
diff --git a/src/chttpd.erl b/src/chttpd.erl
index 6878fa5..632eb3d 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -360,6 +360,7 @@ url_handler("_utils") ->        fun chttpd_misc:handle_utils_dir_req/1;
 url_handler("_all_dbs") ->      fun chttpd_misc:handle_all_dbs_req/1;
 url_handler("_active_tasks") -> fun chttpd_misc:handle_task_status_req/1;
 url_handler("_config") ->       fun chttpd_misc:handle_config_req/1;
+url_handler("_reload_query_servers") -> fun chttpd_misc:handle_reload_query_servers_req/1;
 url_handler("_replicate") ->    fun chttpd_misc:handle_replicate_req/1;
 url_handler("_uuids") ->        fun chttpd_misc:handle_uuids_req/1;
 url_handler("_sleep") ->        fun chttpd_misc:handle_sleep_req/1;

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/12ea8a31/src/chttpd_misc.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_misc.erl b/src/chttpd_misc.erl
index 0a4badf..570df30 100644
--- a/src/chttpd_misc.erl
+++ b/src/chttpd_misc.erl
@@ -12,13 +12,24 @@
 
 -module(chttpd_misc).
 
--export([handle_welcome_req/2,handle_favicon_req/2,handle_utils_dir_req/2,
-    handle_all_dbs_req/1,handle_replicate_req/1,handle_restart_req/1,
-    handle_uuids_req/1,handle_config_req/1,
-    handle_task_status_req/1,handle_sleep_req/1,handle_welcome_req/1,
-    handle_utils_dir_req/1, handle_favicon_req/1, handle_system_req/1,
-    handle_up_req/1]).
-
+-export([
+    handle_all_dbs_req/1,
+    handle_config_req/1,
+    handle_favicon_req/1,
+    handle_favicon_req/2,
+    handle_replicate_req/1,
+    handle_reload_query_servers_req/1,
+    handle_restart_req/1,
+    handle_sleep_req/1,
+    handle_system_req/1,
+    handle_task_status_req/1,
+    handle_up_req/1,
+    handle_utils_dir_req/1,
+    handle_utils_dir_req/2,
+    handle_uuids_req/1,
+    handle_welcome_req/1,
+    handle_welcome_req/2
+]).
 
 -include_lib("couch/include/couch_db.hrl").
 -include_lib("couch_mrview/include/couch_mrview.hrl").
@@ -184,6 +195,11 @@ handle_restart_req(#httpd{method='POST'}=Req) ->
 handle_restart_req(Req) ->
     send_method_not_allowed(Req, "POST").
 
+handle_reload_query_servers_req(#httpd{method='POST'}=Req) ->
+    ok = couch_proc_manager:reload(),
+    send_json(Req, 200, {[{ok, true}]});
+handle_reload_query_servers_req(Req) ->
+    send_method_not_allowed(Req, "POST").
 
 handle_uuids_req(Req) ->
     couch_httpd_misc_handlers:handle_uuids_req(Req).
@@ -262,6 +278,7 @@ handle_system_req(Req) ->
         {io_input, Input},
         {io_output, Output},
         {os_proc_count, couch_proc_manager:get_proc_count()},
+        {stale_proc_count, couch_proc_manager:get_stale_proc_count()},
         {process_count, erlang:system_info(process_count)},
         {process_limit, erlang:system_info(process_limit)},
         {message_queues, message_queues(registered())},