You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2009/04/04 23:47:12 UTC

svn commit: r762019 - /couchdb/trunk/src/couchdb/couch_httpd.erl

Author: kocolosk
Date: Sat Apr  4 21:47:12 2009
New Revision: 762019

URL: http://svn.apache.org/viewvc?rev=762019&view=rev
Log:
Use now_diff instead of statistics(runtime).  Closes COUCHDB-316

Modified:
    couchdb/trunk/src/couchdb/couch_httpd.erl

Modified: couchdb/trunk/src/couchdb/couch_httpd.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?rev=762019&r1=762018&r2=762019&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd.erl Sat Apr  4 21:47:12 2009
@@ -109,7 +109,7 @@
     
 
 handle_request(MochiReq, UrlHandlers, DbUrlHandlers, DesignUrlHandlers) ->
-    statistics(runtime), % prepare request_time counter, see end of function
+    Begin = now(),
     AuthenticationFun = make_arity_1_fun(
             couch_config:get("httpd", "authentication_handler")),
     % for the path, use the raw path with the query string and fragment
@@ -180,7 +180,7 @@
         RawUri,
         Resp:get(code)
     ]),
-    {_TotalRuntime, RequestTime} = statistics(runtime),
+    RequestTime = round(timer:now_diff(now(), Begin)/1000),
     couch_stats_collector:record({couchdb, request_time}, RequestTime),
     couch_stats_collector:increment({httpd, requests}),
     {ok, Resp}.