Simplify parse_diskstats_line() and _calc_delta_for(). Use UPPERCASE for constants. Don't save unused values in dev stats array. Use actual values from an OptionParser/pt-diskstats.

This commit is contained in:
Daniel Nichter
2012-01-12 10:09:40 -07:00
parent 3165b3c0f8
commit 8d70a272fe
4 changed files with 84 additions and 126 deletions

View File

@@ -155,7 +155,7 @@ sub _calc_stats_for_deltas {
my $against = $self->delta_against($dev);
my $delta = $self->_calc_delta_for( $curr, $against );
$delta->{ios_in_progress} = $curr->[Diskstats::ios_in_progress];
$delta->{ios_in_progress} = $curr->[Diskstats::IOS_IN_PROGRESS];
while ( my ( $k, $v ) = each %$delta ) {
$delta_for->{$k} += $v;
}