summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/chttpd.erl7
-rw-r--r--src/chttpd_db.erl1
2 files changed, 6 insertions, 2 deletions
diff --git a/src/chttpd.erl b/src/chttpd.erl
index 1cc15d7e..649b23bc 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -137,14 +137,17 @@ handle_request(MochiReq) ->
end,
RequestTime = round(timer:now_diff(now(), Begin)/1000),
- showroom_log:message(notice, "~s ~s ~s ~s ~B ~B", [
+ RequestInfo = [
MochiReq:get(peer),
MochiReq:get_header_value("Host"),
atom_to_list(Method1),
RawUri,
Resp:get(code),
RequestTime
- ]),
+ ],
+ Customer = cloudant_util:customer_name(HttpReq),
+ couch_metrics_req:notify({request, [Customer|RequestInfo]}),
+ showroom_log:message(notice, "~s ~s ~s ~s ~B ~B", RequestInfo),
couch_stats_collector:record({couchdb, request_time}, RequestTime),
couch_stats_collector:increment({httpd, requests}),
{ok, Resp}.
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 306d6fea..9e04ffa1 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -143,6 +143,7 @@ create_db_req(#httpd{user_ctx=UserCtx}=Req, DbName) ->
delete_db_req(#httpd{user_ctx=UserCtx}=Req, DbName) ->
case fabric:delete_db(DbName, [{user_ctx, UserCtx}]) of
ok ->
+ couch_metrics_disk:notify({db_delete, {UserCtx#user_ctx.name, DbName}}),
send_json(Req, 200, {[{ok, true}]});
Error ->
throw(Error)