Skip to content

Commit

Permalink
improve mogadm rebalance output.
Browse files Browse the repository at this point in the history
git-svn-id: http://code.sixapart.com/svn/mogilefs/trunk@1496 f67b2e87-0811-0410-a7e0-dd94e48410d6
  • Loading branch information
dormando committed Sep 19, 2010
1 parent 8e338c6 commit affc838
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions mogadm
Original file line number Diff line number Diff line change
Expand Up @@ -945,21 +945,27 @@ sub cmd_rebalance_test {
my $s = $mogadm->server_settings;
print "Policy: ", $s->{rebal_policy}, "\n\n";
print "Source devices:\n";
for my $dev (split /,/, $res->{sdevs}) {
for my $dev (sort split /,/, $res->{sdevs}) {
print " - ", $dev, "\n";
}
print "Destination devices:\n";
for my $dev (split /,/, $res->{ddevs}) {
for my $dev (sort split /,/, $res->{ddevs}) {
print " - ", $dev, "\n";
}
}

sub cmd_rebalance_status {
my $mogadm = mogadm();

my $ss = $mogadm->server_settings or fail ($mogadm->errstr);
my $res = $mogadm->rebalance_status or fail ($mogadm->errstr);
if ($ss->{rebal_host}) {
print "Rebalance is running\n";
} else {
print "Rebalance is stopped\n";
}
print "Rebalance status:\n";
for my $o (split /\s+/, $res->{state}) {
for my $o (sort split /\s+/, $res->{state}) {
my ($k, $v) = split /=/, $o;
printf("%25s = %-s\n", $k, $v);
}
Expand Down

0 comments on commit affc838

Please sign in to comment.