Patch to deal with single-device iostat

Nathan Schmidt nschmidt at gmail.com
Fri Feb 2 01:01:16 UTC 2007


We've got a number of machines whose mogile storage isn't on an  
explicit device (i.e. just a path in the /var/mogdata/ hierarchy) so  
they don't register properly with the iostat listener -- (i.e. "dev3  
is 13d, not 2049d"). This patch recognizes that case and just reports  
the base device's utilization.

Regards,
-Nathan / PBwiki


Index: mogstored
===================================================================
--- mogstored   (revision 726)
+++ mogstored   (working copy)
@@ -407,6 +420,10 @@
                  foreach my $mogdevid (sort { $a <=> $b } keys % 
$mog_sysid) {
                      my $devt = $mog_sysid->{$mogdevid};
                      my $ut = defined $devt_util{$devt} ? $devt_util 
{$devt} : "-";
+                    if(($ut eq '-') && (1 == keys %devt_util)) {
+                      #if not found through traditional means, and  
only one device, then use that device's utilization
+                      $ut = (values %devt_util)[0];
+                    }
                      $ret .= "$mogdevid\t$ut\n";
                  }
                  $ret .= ".\n";



More information about the mogilefs mailing list