Skip to content

Commit

Permalink
remove deprecated stats code from mogadm
Browse files Browse the repository at this point in the history
git-svn-id: http://code.sixapart.com/svn/mogilefs/trunk@1488 f67b2e87-0811-0410-a7e0-dd94e48410d6
  • Loading branch information
dormando committed Sep 19, 2010
1 parent ace9ae9 commit e6ddaa7
Showing 1 changed file with 1 addition and 44 deletions.
45 changes: 1 addition & 44 deletions mogadm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ my $usage = {
des => "Check the state of the MogileFS world.",
},
stats => {
des => "Show MogileFS system statistics. (DEPRECIATED: use mogstats instead)",
des => "Show MogileFS system statistics. (DEPRECATED: use mogstats instead)",
},
settings => {
des => "Change/list server settings.",
Expand Down Expand Up @@ -513,49 +513,6 @@ sub cmd_check {

sub cmd_stats {
fail("mogadm stats is deprecated by new 'mogstats' utility");
print "Fetching statistics...\n";
my $stats = stats()
or fail("Can't fetch stats");

print "\nStatistics for devices...\n";
printf " %-10s %-10s %10s %10s\n", "device", "host", "files", "status";
printf " ---------- ----------- ---------- ----------\n";
foreach my $device (sort { $a <=> $b } keys %{$stats->{devices}}) {
my $value = $stats->{devices}->{$device};
printf " %-10s %-10s %10s %10s\n", "dev$device", $value->{host}, $value->{files}, $value->{status};
}
printf " ---------- ----------- ---------- ----------\n";

print "\nStatistics for file ids...\n";
printf " Max file id: %s\n", $stats->{fids}->{max} || 'none';

print "\nStatistics for files...\n";
printf " %-20s %-10s %10s\n", 'domain', 'class', 'files';
printf " -------------------- ----------- ----------\n";
foreach my $domain (sort keys %{$stats->{files}}) {
my $classes = $stats->{files}->{$domain};
foreach my $class (sort keys %$classes) {
my $files = $classes->{$class};
printf " %-20s %-10s %10s\n", $domain, $class, $files;
}
}
printf " -------------------- ----------- ----------\n";

print "\nStatistics for replication...\n";
printf " %-20s %-10s %10s %10s\n", 'domain', 'class', 'devcount', 'files';
printf " -------------------- ----------- ---------- ----------\n";
foreach my $domain (sort keys %{$stats->{replication}}) {
my $classes = $stats->{replication}->{$domain};
foreach my $class (sort keys %$classes) {
my $devcounts = $classes->{$class};
foreach my $devcount (sort { $a <=> $b } keys %$devcounts) {
my $files = $devcounts->{$devcount};
printf " %-20s %-10s %10s %10s\n", $domain, $class, $devcount, $files;
}
}
}
printf " -------------------- ----------- ---------- ----------\n";
ok();
}

sub cmd_host_list {
Expand Down

0 comments on commit e6ddaa7

Please sign in to comment.