]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
AsyncConnection: Fix msgr send bytes perf counter statistic 5035/head
authorHaomai Wang <haomaiwang@gmail.com>
Mon, 22 Jun 2015 05:01:24 +0000 (13:01 +0800)
committerHaomai Wang <haomaiwang@gmail.com>
Mon, 22 Jun 2015 05:01:48 +0000 (13:01 +0800)
prepare_send_message may be called twice, we need to move to write_message

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
src/msg/async/AsyncConnection.cc

index 921b9ba75072fe5b92f5da54fabf451f442a4003..977415011edd59a36bee72d5731f26af5281364d 100644 (file)
@@ -2238,7 +2238,6 @@ void AsyncConnection::prepare_send_message(uint64_t features, Message *m, buffer
     old_footer.flags = footer.flags;
     bl.append((char*)&old_footer, sizeof(old_footer));
   }
-  logger->inc(l_msgr_send_bytes, bl.length());
 }
 
 int AsyncConnection::write_message(Message *m, bufferlist& bl)
@@ -2276,6 +2275,7 @@ int AsyncConnection::write_message(Message *m, bufferlist& bl)
 
   complete_bl.claim_append(bl);
 
+  logger->inc(l_msgr_send_bytes, bl.length());
   ldout(async_msgr->cct, 20) << __func__ << " sending " << m->get_seq()
                              << " " << m << dendl;
   int rc = _try_send(complete_bl);