print disk byte metrics

This commit is contained in:
Doug MacEachern 2005-04-07 01:24:29 +00:00
parent a3dd84419b
commit fe14eb78f0
1 changed files with 5 additions and 2 deletions

View File

@ -17,14 +17,15 @@ import net.hyperic.sigar.util.GetlineCompleter;
public class Iostat extends SigarCommandBase { public class Iostat extends SigarCommandBase {
private static final String OUTPUT_FORMAT = private static final String OUTPUT_FORMAT =
"%-15s %-15s %-10s %-10s"; "%-15s %-15s %-10s %-10s %-10s %-10s";
//like df -h -a
private static final String[] HEADER = new String[] { private static final String[] HEADER = new String[] {
"Filesystem", "Filesystem",
"Mounted on", "Mounted on",
"Reads", "Reads",
"Writes", "Writes",
"Bytes Read",
"Bytes Written",
}; };
private GetlineCompleter completer; private GetlineCompleter completer;
@ -96,6 +97,8 @@ public class Iostat extends SigarCommandBase {
items.add(fs.getDirName()); items.add(fs.getDirName());
items.add(String.valueOf(usage.getDiskReads())); items.add(String.valueOf(usage.getDiskReads()));
items.add(String.valueOf(usage.getDiskWrites())); items.add(String.valueOf(usage.getDiskWrites()));
items.add(Sigar.formatSize(usage.getDiskReadBytes()));
items.add(Sigar.formatSize(usage.getDiskWriteBytes()));
printf(items); printf(items);
} }