Removed the handling of the partition format.

/proc/diskstats actually has two formats, one for devices, one for
partitions. The latter wasn't handled by the original pt-diskstats,
but one of the previous commits introducing some minimal handling
for that. This commit removes that, since the partition format
doesn't have enough information to be useful.
This commit is contained in:
Brian Fraser
2012-01-10 14:28:24 -03:00
parent 13210d1978
commit eaae370f81

View File

@@ -519,36 +519,6 @@ sub _parse_diskstats_line {
return ( $dev, \%dev_stats ); return ( $dev, \%dev_stats );
} }
elsif ((@dev_stats{qw( major minor )}, $dev,
@dev_stats{ qw( reads read_sectors writes written_sectors ) }) =
$line =~ /^
# Partition format
\s* (\d+) # major
\s+ (\d+) # minor
\s+ (.+?) # Device name
\s+ (\d+) # # of reads issued
\s+ (\d+) # # of sectors read
\s+ (\d+) # # of writes issued
\s+ (\d+) # # of sectors written
\s*$/x)
{
for my $key ( @diskstats_fields ) {
# Unintiialized values should be 0
$dev_stats{$key} ||= 0;
}
# Copypaste from above, should probably abstract, but it would make
# the common case slower.
$dev_stats{read_bytes} = $dev_stats{read_sectors} * $block_size;
$dev_stats{written_bytes} =
$dev_stats{written_sectors} * $block_size;
$dev_stats{read_kbs} = $dev_stats{read_bytes} / 1024;
$dev_stats{written_kbs} = $dev_stats{written_bytes} / 1024;
$dev_stats{ios_requested} = $dev_stats{reads} + $dev_stats{writes};
$dev_stats{ios_in_bytes} = $dev_stats{read_bytes}
+ $dev_stats{written_bytes};
return ( $dev, \%dev_stats );
}
else { else {
return; return;
} }