<div dir="ltr">Reviewed-by: Robin Dong <<a href="mailto:sanbai@taobao.com">sanbai@taobao.com</a>></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014/1/8 Liu Yuan <span dir="ltr"><<a href="mailto:namei.unix@gmail.com" target="_blank">namei.unix@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is useful to determine the transaction per second the sheep daemon perform.<br>
Also fixed a bug that READ and WRITE column name are reverse.<br>
<br>
Signed-off-by: Liu Yuan <<a href="mailto:namei.unix@gmail.com">namei.unix@gmail.com</a>><br>
---<br>
 dog/common.c |  2 +-<br>
 dog/dog.h    |  1 +<br>
 dog/node.c   | 18 +++++++++++-------<br>
 3 files changed, 13 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/dog/common.c b/dog/common.c<br>
index 0535a44..93adb85 100644<br>
--- a/dog/common.c<br>
+++ b/dog/common.c<br>
@@ -14,7 +14,7 @@<br>
 #include "sockfd_cache.h"<br>
 #include "fec.h"<br>
<br>
-static char *strnumber_raw(uint64_t _size, bool raw)<br>
+char *strnumber_raw(uint64_t _size, bool raw)<br>
 {<br>
        const char *units[] = {"MB", "GB", "TB", "PB", "EB", "ZB", "YB"};<br>
        static __thread struct size_str {<br>
diff --git a/dog/dog.h b/dog/dog.h<br>
index 73518d4..12dfc52 100644<br>
--- a/dog/dog.h<br>
+++ b/dog/dog.h<br>
@@ -66,6 +66,7 @@ extern int sd_nodes_nr;<br>
<br>
 bool is_current(const struct sd_inode *i);<br>
 char *strnumber(uint64_t _size);<br>
+char *strnumber_raw(uint64_t _size, bool raw);<br>
 typedef void (*vdi_parser_func_t)(uint32_t vid, const char *name,<br>
                                  const char *tag, uint32_t snapid,<br>
                                  uint32_t flags,<br>
diff --git a/dog/node.c b/dog/node.c<br>
index 71486a0..b2b1c86 100644<br>
--- a/dog/node.c<br>
+++ b/dog/node.c<br>
@@ -298,27 +298,31 @@ again:<br>
                        first = false;<br>
                }<br>
                printf("%s%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t"<br>
-                      "%"PRIu64"\t%"PRIu64"\t%s\t%s\t%s\t%s\n",<br>
+                      "%"PRIu64"\t%"PRIu64"\t%s\t%s\t%s\t%s\t%s\n",<br>
                       raw_output ? "" :<br>
                       "Request\tActive\tTotal\tWrite\tRead\tRemove\tFlush\t"<br>
-                      "All WR\tAll RD\tWRBW\tRDBW\nClient\t",<br>
+                      "All WR\tAll RD\tWRBW\tRDBW\tRPS\nClient\t",<br>
                       stat.r.gway_active_nr, stat.r.gway_total_nr,<br>
-                      stat.r.gway_total_read_nr, stat.r.gway_total_write_nr,<br>
+                      stat.r.gway_total_write_nr, stat.r.gway_total_read_nr,<br>
                       stat.r.gway_total_remove_nr, stat.r.gway_total_flush_nr,<br>
                       strnumber(stat.r.gway_total_rx),<br>
                       strnumber(stat.r.gway_total_tx),<br>
                       strnumber(stat.r.gway_total_rx - last.r.gway_total_rx),<br>
-                      strnumber(stat.r.gway_total_tx - last.r.gway_total_tx));<br>
+                      strnumber(stat.r.gway_total_tx - last.r.gway_total_tx),<br>
+                      strnumber_raw(stat.r.gway_total_nr -<br>
+                                    last.r.gway_total_nr, true));<br>
                printf("%s%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t"<br>
-                      "%"PRIu64"\t%"PRIu64"\t%s\t%s\t%s\t%s\n",<br>
+                      "%"PRIu64"\t%"PRIu64"\t%s\t%s\t%s\t%s\t%s\n",<br>
                       raw_output ? "" : "Peer\t",<br>
                       stat.r.peer_active_nr, stat.r.peer_total_nr,<br>
-                      stat.r.peer_total_read_nr, stat.r.peer_total_write_nr,<br>
+                      stat.r.peer_total_write_nr, stat.r.peer_total_read_nr,<br>
                       stat.r.peer_total_remove_nr, 0UL,<br>
                       strnumber(stat.r.peer_total_rx),<br>
                       strnumber(stat.r.peer_total_tx),<br>
                       strnumber(stat.r.peer_total_rx - last.r.peer_total_rx),<br>
-                      strnumber(stat.r.peer_total_tx - last.r.peer_total_tx));<br>
+                      strnumber(stat.r.peer_total_tx - last.r.peer_total_tx),<br>
+                      strnumber_raw(stat.r.peer_total_nr -<br>
+                                    last.r.peer_total_nr, true));<br>
                last = stat;<br>
                sleep(1);<br>
                goto again;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.1.2<br>
<br>
--<br>
sheepdog mailing list<br>
<a href="mailto:sheepdog@lists.wpkg.org">sheepdog@lists.wpkg.org</a><br>
<a href="http://lists.wpkg.org/mailman/listinfo/sheepdog" target="_blank">http://lists.wpkg.org/mailman/listinfo/sheepdog</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>--<br>Best Regard<br>Robin Dong
</div>