diff options
author | Damien F. Katz <damien@apache.org> | 2009-01-19 23:31:51 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2009-01-19 23:31:51 +0000 |
commit | 06a084d40de16f72b6278a63f4c06c2d2b0c9281 (patch) | |
tree | e0a9343947bd2446684c31a5d23231f88e07ac75 /src/couchdb/couch_httpd_misc_handlers.erl | |
parent | 40aa5a760553eda80fbe06e9a00dee85adc01765 (diff) |
tests for fix to COUCHDB-215, and changing of how max_dbs_open setting is handled at runtime.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@735875 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_misc_handlers.erl')
-rw-r--r-- | src/couchdb/couch_httpd_misc_handlers.erl | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl index c9a56c5c..5a1f6ee4 100644 --- a/src/couchdb/couch_httpd_misc_handlers.erl +++ b/src/couchdb/couch_httpd_misc_handlers.erl @@ -12,9 +12,9 @@ -module(couch_httpd_misc_handlers). --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]). +-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_stats_req/1]). -export([increment_update_seq_req/2]). @@ -31,8 +31,7 @@ handle_welcome_req(#httpd{method='GET'}=Req, WelcomeMessage) -> send_json(Req, {[ {couchdb, WelcomeMessage}, - {version, list_to_binary(couch_server:get_version())}, - {start_time, list_to_binary(couch_server:get_start_time())} + {version, list_to_binary(couch_server:get_version())} ]}); handle_welcome_req(Req, _) -> send_method_not_allowed(Req, "GET,HEAD"). @@ -62,6 +61,11 @@ handle_all_dbs_req(#httpd{method='GET'}=Req) -> handle_all_dbs_req(Req) -> send_method_not_allowed(Req, "GET,HEAD"). +handle_stats_req(#httpd{method='GET'}=Req) -> + ok = couch_httpd:verify_is_server_admin(Req), + send_json(Req, {couch_server:get_stats() ++ couch_file_stats:get_stats()}); +handle_stats_req(Req) -> + send_method_not_allowed(Req, "GET,HEAD"). handle_replicate_req(#httpd{user_ctx=UserCtx,method='POST'}=Req) -> {Props} = couch_httpd:json_body(Req), |