[PATCH] dog: do NOT calc vdi size when dog node info -r

5 views
Skip to first unread message

Meng Lingkun

unread,
Dec 5, 2016, 9:49:11 AM12/5/16
to sheep...@googlegroups.com, Meng Lingkun
There are three reasons:
1. As designed now, do NOT output total virtual image size.
2. For monitoring and maintenance, just each node size info is enough
most of the time.
3. Getting total vdi size is time-consuming, especially where the
cluster is in recovery and inodes are not cached in memory.

Signed-off-by: Meng Lingkun <mengl...@cmss.chinamobile.com>
---
dog/node.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/dog/node.c b/dog/node.c
index 741f00c..607c691 100644
--- a/dog/node.c
+++ b/dog/node.c
@@ -130,9 +130,10 @@ static int node_info(int argc, char **argv)
return EXIT_SYSFAIL;
}

- if (parse_vdi(cal_total_vdi_size, SD_INODE_HEADER_SIZE,
- &total_vdi_size, true) < 0)
- return EXIT_SYSFAIL;
+ if (!raw_output)
+ if (parse_vdi(cal_total_vdi_size, SD_INODE_HEADER_SIZE,
+ &total_vdi_size, true) < 0)
+ return EXIT_SYSFAIL;

printf(raw_output ? "Total %s %s %s %d%% %s\n"
: "Total\t%s\t%s\t%s\t%3d%%\n\n"
--
1.8.3.1



Liu Yuan

unread,
Dec 5, 2016, 10:48:41 PM12/5/16
to Meng Lingkun, sheep...@googlegroups.com
On Mon, Dec 05, 2016 at 10:47:40PM +0800, Meng Lingkun wrote:
> There are three reasons:
> 1. As designed now, do NOT output total virtual image size.
> 2. For monitoring and maintenance, just each node size info is enough
> most of the time.
> 3. Getting total vdi size is time-consuming, especially where the
> cluster is in recovery and inodes are not cached in memory.
>

Applied thanks.

Yuan
Reply all
Reply to author
Forward
0 new messages