Changeset 1484
- Timestamp:
- 02/19/08 19:23:45 (4 years ago)
- Files:
-
- people/ssm/plugins/iostat/iostat_latency (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
people/ssm/plugins/iostat/iostat_latency
r1478 r1484 83 83 if ($stats{$device}{'type'} eq 'disk') { 84 84 foreach my $operation ("read", "write") { 85 printf("%s_%s.label %s\n", $device, $operation, $device) 86 if($stats{$device}{'active'}); 87 } 85 if($stats{$device}{'active'}) { 86 # Label 87 printf("%s_%s.label %s\n", $device, $operation, $device); 88 # Info 89 if ($stats{$device}{'info'}) { 90 printf("%s_%s.info %s\n", $device, $operation, 91 $stats{$device}{'info'}); 92 } 93 } 94 } 88 95 } 89 96 } … … 99 106 if ($stats{$device}{'type'} eq 'disk') { 100 107 foreach my $operation ("read", "write") { 101 printf("%s_%s.value %f\n", $device, $operation, 102 &iotime(\%stats, $device, $operation)) 103 if($stats{$device}{'active'}); 108 if($stats{$device}{'active'}) { 109 printf("%s_%s.value %f\n", $device, $operation, 110 &iotime(\%stats, $device, $operation)); 111 } 112 104 113 } 105 114 } … … 188 197 # Find a device mapper name, for "dm-*" 189 198 if ($diskstats{$device}{'major'} == $DM_MAJOR) { 190 191 ## XXX: Add metadata 199 200 my $info = &dm_name($diskstats{$device}{'major'}, 201 $diskstats{$device}{'minor'}); 202 203 if ($info =~ /[0-9A-Za-z\-_+]/) { 204 $diskstats{$device}{'info'} = "Device-mapper: " . $info; 205 } 192 206 } 193 207 … … 218 232 219 233 # Sanity check, both $major and $minor should be an integer 220 die unless ($major ~ /^\d+$/ && $minor ~ /^\d+$/); 221 222 # XXX: Run /sbin/dmsetup info --major $major --minor $minor, look 223 # for Name:. (perlfaq8) 224 225 } 234 die unless ($major =~ /^\d+$/ && $minor =~ /^\d+$/); 235 236 my $foo = open(DMSETUP, "/sbin/dmsetup info --major $major --minor $minor |"); 237 while (<DMSETUP>) { 238 if (/^Name:\s+(\S+)/) { 239 return $1; 240 } 241 } 242 243 }
