Updated example to display read/write counters.
svn path=/trunk/; revision=2756
This commit is contained in:
@@ -15,12 +15,14 @@ static void print_fsusage(const char *mountpoint)
|
|||||||
|
|
||||||
glibtop_get_fsusage(&buf, mountpoint);
|
glibtop_get_fsusage(&buf, mountpoint);
|
||||||
|
|
||||||
printf("%-20s %-10llu %-10llu %-10llu %.1f\n",
|
printf("%-30s %10llu %10llu %10llu %5.1f %10llu %10llu\n",
|
||||||
mountpoint,
|
mountpoint,
|
||||||
buf.blocks * buf.block_size >> 20,
|
buf.blocks * buf.block_size >> 20,
|
||||||
(buf.blocks - buf.bavail) * buf.block_size >> 20,
|
(buf.blocks - buf.bavail) * buf.block_size >> 20,
|
||||||
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();
|
glibtop_init();
|
||||||
|
|
||||||
printf("%-20s %-10s %-10s %-10s %-10s\n",
|
printf("%-30s %10s %10s %10s %5s %10s %10s\n",
|
||||||
"Filesystem", "Size", "Used", "Avail", "Use%");
|
"Filesystem", "Size", "Used", "Avail", "Use%", "Read", "Write");
|
||||||
|
|
||||||
entries = glibtop_get_mountlist(&buf, TRUE);
|
entries = glibtop_get_mountlist(&buf, TRUE);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user