]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: reset timestamp when processing starts
authorYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 17 Jan 2012 21:39:43 +0000 (13:39 -0800)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 17 Jan 2012 21:42:22 +0000 (13:42 -0800)
otherwise we'd count also the time waiting for the request.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
src/rgw/rgw_main.cc

index d81abb9d8bd0726793e21cef9a47f93ca7146b97..52f2fbe592cd4022c5ad6aa9cfaf98a17ee1f829 100644 (file)
@@ -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);