From 134dc2c24f08ef7487fcdf5c5d751603a5ed14a6 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Fri, 16 Jul 2010 11:07:22 -0400 Subject: measure all get_db_info calls --- src/chttpd_db.erl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl index 22ca7fe6..bd11683b 100644 --- a/src/chttpd_db.erl +++ b/src/chttpd_db.erl @@ -174,7 +174,11 @@ do_db_req(#httpd{path_parts=[DbName|_]}=Req, Fun) -> Fun(Req, #db{name=DbName}). db_req(#httpd{method='GET',path_parts=[DbName]}=Req, _Db) -> + % measure the time required to generate the etag, see if it's worth it + T0 = now(), {ok, DbInfo} = fabric:get_db_info(DbName), + DeltaT = timer:now_diff(now(), T0) / 1000, + couch_stats_collector:record({couchdb, dbinfo}, DeltaT), send_json(Req, {cloudant_util:customer_db_info(Req, DbInfo)}); db_req(#httpd{method='POST', path_parts=[DbName], user_ctx=Ctx}=Req, Db) -> -- cgit v1.2.3