From eaae370f81e6317af13236a12b88e978e669111a Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Tue, 10 Jan 2012 14:28:24 -0300 Subject: [PATCH] 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. --- lib/Diskstats.pm | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/lib/Diskstats.pm b/lib/Diskstats.pm index 41c95145..22f4b64b 100644 --- a/lib/Diskstats.pm +++ b/lib/Diskstats.pm @@ -519,36 +519,6 @@ sub _parse_diskstats_line { 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 { return; }