Specifications
Analyze Collected Detailed Rate of Change Data
'ios_pending' => 11,
'ms_time_total' => 12,
'weighted_ms_time_total' => 13 );
my $devfield = $fields{'dev'};
my $calcfield = $ENV{'ROC_CALC_FIELD'} || $fields{'sectors_written'};
dbg "using field $calcfield\n";
open(FD, "$file") or die "Cannot open $file: $!\n";
foreach (<FD>) {
chomp;
@_ = split;
if (exists($days{$_[0]})) {# skip datestamp divider
if ($firsttime eq '') {
$firsttime = join ' ', @_[0..5];
}
$lasttime = join ' ', @_[0..5];
next;
}
next if ($_[0] !~ /[0-9]/); # ignore
if (!%devs || exists $devs{$_[$devfield]}) {
push @{$stat{$_[$devfield]}}, $_[$calcfield];
}
}
@{$stat{'total'}} = totals(\%stat);
printf "Sample start time: %s\n", scalar(localtime($starttime));
printf "Sample end time: %s\n", scalar(localtime($starttime + ((@{$stat
{'total'}} - 1) * $interval)));
printf "Sample interval: %ss #Samples: %s Sample length: %ss\n",
$interval, (@{$stat{'total'}} - 1), (@{$stat{'total'}} - 1) * $interval;
print "(Raw times from file: $firsttime, $lasttime)\n";
print "Rate of change for devices " . (join ', ', sort keys %stat) .
"\n";
foreach (sort keys %stat) {
my @vals = @{$stat{$_}};
my ($max, $maxindex, $roc) = roc($_, $blksize, $interval, @vals);
printf "$_ peak:%sB/s (%sb/s) (@ %s) average:%sB/s (%sb/s)\n", HumanSize
($max), HumanSize($max * 8), scalar localtime($starttime + ($maxindex *
$interval)), HumanSize($roc), HumanSize($roc * 8);
}
# functions
sub roc {
SteelEye Protection Suite for Linux271