From: Yehuda Sadeh Date: Tue, 17 Jan 2012 21:39:43 +0000 (-0800) Subject: rgw: reset timestamp when processing starts X-Git-Tag: v0.41~29^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4c6c4430a4cec7c8742f52ef65dfe929ae1f4ef6;p=ceph.git rgw: reset timestamp when processing starts otherwise we'd count also the time waiting for the request. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index d81abb9d8bd..52f2fbe592c 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -74,7 +74,6 @@ struct RGWRequest utime_t ts; RGWRequest() : id(0), s(NULL), op(NULL) { - ts = ceph_clock_now(g_ceph_context); } ~RGWRequest() { @@ -91,7 +90,6 @@ struct RGWRequest #define LARGE_SIZE 1024 char buf[LARGE_SIZE]; va_list ap; - const char *format; va_start(ap, fmt); vsnprintf(buf, sizeof(buf), fmt, ap); @@ -100,9 +98,8 @@ struct RGWRequest log(s, buf); } - uint64_t timestamp() { - utime_t t = ceph_clock_now(g_ceph_context) - ts; - return t.sec() * (1000000LL) + t.usec(); + void log_init() { + ts = ceph_clock_now(g_ceph_context); } void log(struct req_state *s, const char *msg) { @@ -231,6 +228,8 @@ void RGWProcess::handle_request(RGWRequest *req) int ret; RGWEnv rgw_env; + req->log_init(); + dout(0) << "====== starting new request req=" << hex << req << dec << " =====" << dendl; perfcounter->inc(l_rgw_req);