Commit 194203a8 authored by Mike Hibler's avatar Mike Hibler
Browse files

Teach it how to summarize for multiple nodes

parent f51cd81e
...@@ -146,11 +146,6 @@ if (!$list && !$summary) { ...@@ -146,11 +146,6 @@ if (!$list && !$summary) {
$list = 1; $list = 1;
} }
if ($showall && $summary) {
print STDERR "Cannot summarize for all nodes (yet)\n";
exit(1) if (!$list);
}
# #
# Common case: a single node. # Common case: a single node.
# Just fetch data for it, otherwise fetch data for all. # Just fetch data for it, otherwise fetch data for all.
...@@ -302,36 +297,39 @@ for my $rec (@records) { ...@@ -302,36 +297,39 @@ for my $rec (@records) {
} }
} }
print scalar(@records) . " records\n"
if ($list && $verbose);
# #
# Print out summary information # Print out summary information
# We can do this for all nodes, but how do we present it?
# #
my $node = $nodes[0]; # XXX for $node (sort keys(%nodestats)) {
if ($summary && defined($nodestats{$node})) { if ($summary && defined($nodestats{$node})) {
my ($ftime, $atime, $rtime, $dtime) = @{$nodestats{$node}}; my ($ftime, $atime, $rtime, $dtime) = @{$nodestats{$node}};
my $ttime = $ftime + $atime + $rtime + $dtime; my $ttime = $ftime + $atime + $rtime + $dtime;
if ($verbose) { if ($verbose) {
my $pct; my $pct;
print "$node SUMMARY\n"; print "$node SUMMARY\n";
if ($atime > 0) { if ($atime > 0) {
$pct = ($atime * 100) / $ttime; $pct = ($atime * 100) / $ttime;
printf(" Allocted: %9d sec (%5.1f%%)\n", $atime, $pct); printf(" Allocted: %9d sec (%5.1f%%)\n", $atime, $pct);
} }
if ($ftime > 0) { if ($ftime > 0) {
$pct = ($ftime * 100) / $ttime; $pct = ($ftime * 100) / $ttime;
printf(" Free: %9d sec (%5.1f%%)\n", $ftime, $pct); printf(" Free: %9d sec (%5.1f%%)\n", $ftime, $pct);
} }
if ($rtime > 0) { if ($rtime > 0) {
$pct = ($rtime * 100) / $ttime; $pct = ($rtime * 100) / $ttime;
printf(" Reloading: %9d sec (%5.1f%%)\n", $rtime, $pct); printf(" Reloading: %9d sec (%5.1f%%)\n", $rtime, $pct);
} }
if ($dtime > 0) { if ($dtime > 0) {
$pct = ($dtime * 100) / $ttime; $pct = ($dtime * 100) / $ttime;
printf(" Down: %9d sec (%5.1f%%)\n", $dtime, $pct); printf(" Down: %9d sec (%5.1f%%)\n", $dtime, $pct);
}
} else {
print "$node SUM $atime $ftime $rtime $dtime\n";
} }
} else {
print "$node SUM $atime $ftime $rtime $dtime\n";
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment