From: Sage Weil Date: Thu, 2 Feb 2012 21:48:26 +0000 (-0800) Subject: encoding: document ENCODE_DUMP throttling weirdness X-Git-Tag: v0.44~93^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a0dde42287144cb410ce9602cabd389437c19203;p=ceph.git encoding: document ENCODE_DUMP throttling weirdness Signed-off-by: Sage Weil --- diff --git a/src/include/encoding.h b/src/include/encoding.h index 451e287ab67d..f304502082ff 100644 --- a/src/include/encoding.h +++ b/src/include/encoding.h @@ -114,6 +114,9 @@ WRITE_INTTYPE_ENCODER(int16_t, le16) # define ENCODE_DUMP_PRE() \ unsigned pre_off = bl.length() + +// NOTE: This is almost an exponential backoff, but because we count +// bits we get a better sample of things we encode later on. # define ENCODE_DUMP_POST(cl) \ do { \ static int i = 0; \ diff --git a/src/msg/Message.cc b/src/msg/Message.cc index 6be198df6b8b..50330a335256 100644 --- a/src/msg/Message.cc +++ b/src/msg/Message.cc @@ -166,6 +166,9 @@ void Message::encode(uint64_t features, bool datacrc) ::encode(get_middle(), bl); ::encode(get_data(), bl); + // this is almost an exponential backoff, except because we count + // bits we tend to sample things we encode later, which should be + // more representative. static int i = 0; i++; int bits = 0;