libgtop r2756 - trunk/examples
- From: bdejean svn gnome org
- To: svn-commits-list gnome org
- Subject: libgtop r2756 - trunk/examples
- Date: Sun, 22 Jun 2008 10:50:29 +0000 (UTC)
Author: bdejean
Date: Sun Jun 22 10:50:29 2008
New Revision: 2756
URL: http://svn.gnome.org/viewvc/libgtop?rev=2756&view=rev
Log:
Updated example to display read/write counters.
Modified:
trunk/examples/df.c
Modified: trunk/examples/df.c
==============================================================================
--- trunk/examples/df.c (original)
+++ trunk/examples/df.c Sun Jun 22 10:50:29 2008
@@ -15,12 +15,14 @@
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 @@
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]