From 05838650cfd06fa27f07d0a13b80617879b381e3 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Sat, 4 Apr 2009 21:47:12 +0000 Subject: Use now_diff instead of statistics(runtime). Closes COUCHDB-316 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@762019 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_httpd.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/couchdb') diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl index 4acc3d44..aa78ebb2 100644 --- a/src/couchdb/couch_httpd.erl +++ b/src/couchdb/couch_httpd.erl @@ -109,7 +109,7 @@ stop() -> 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 @@ handle_request(MochiReq, UrlHandlers, DbUrlHandlers, DesignUrlHandlers) -> 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}. -- cgit v1.2.3