AsyncConnection: Fix msgr send bytes perf counter statistic

prepare_send_message may be called twice, we need to move to write_message

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
This commit is contained in:
Haomai Wang 2015-06-22 13:01:24 +08:00
parent c71a2f5a6b
commit 53d6c1f179

View 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);