From 229eab1213b56fdfddda8a2e83114fbdc5e5d1ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dejean?= Date: Sun, 22 Jun 2008 10:50:29 +0000 Subject: Updated example to display read/write counters. svn path=/trunk/; revision=2756 --- examples/df.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'examples/df.c') diff --git a/examples/df.c b/examples/df.c index 60e94e82..27be1371 100644 --- a/examples/df.c +++ b/examples/df.c @@ -15,12 +15,14 @@ static void print_fsusage(const char *mountpoint) glibtop_get_fsusage(&buf, mountpoint); - printf("%-20s %-10llu %-10llu %-10llu %.1f\n", + printf("%-30s %10llu %10llu %10llu %5.1f %10llu %10llu\n", mountpoint, buf.blocks * buf.block_size >> 20, (buf.blocks - buf.bavail) * buf.block_size >> 20, buf.bavail * buf.block_size >> 20, - (buf.blocks - buf.bavail) * 100.0 / buf.blocks + (buf.blocks - buf.bavail) * 100.0 / (buf.blocks ? buf.blocks : 1.0), + buf.read, + buf.write ); } @@ -33,8 +35,8 @@ int main() glibtop_init(); - printf("%-20s %-10s %-10s %-10s %-10s\n", - "Filesystem", "Size", "Used", "Avail", "Use%"); + printf("%-30s %10s %10s %10s %5s %10s %10s\n", + "Filesystem", "Size", "Used", "Avail", "Use%", "Read", "Write"); entries = glibtop_get_mountlist(&buf, TRUE); -- cgit v1.2.1