couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r762019 - /couchdb/trunk/src/couchdb/couch_httpd.erl
Date Sat, 04 Apr 2009 21:47:12 GMT
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}.



Mime
View raw message