]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
encoding: document ENCODE_DUMP throttling weirdness
authorSage Weil <sage.weil@dreamhost.com>
Thu, 2 Feb 2012 21:48:26 +0000 (13:48 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Thu, 2 Feb 2012 21:48:26 +0000 (13:48 -0800)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/include/encoding.h
src/msg/Message.cc

index 451e287ab67defd185310e3369ff7834c79b04de..f304502082ffec8fa19ceaf78cf4bbee042c9848 100644 (file)
@@ -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;                                                  \
index 6be198df6b8b7ce26a59a2260745e82f267b0daa..50330a335256523ada139e40e20537fbcff3a6c6 100644 (file)
@@ -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;