Commit b376ba22 authored by Kevin Atkinson's avatar Kevin Atkinson
Browse files

Allow different start time for individual node classes.

parent b80ba9b4
...@@ -26,6 +26,15 @@ my $start = ceil($START / $interval) * $interval; ...@@ -26,6 +26,15 @@ my $start = ceil($START / $interval) * $interval;
my @idxs = (0 .. $#to_plot); my @idxs = (0 .. $#to_plot);
my @start;
foreach (@idxs) {
if (defined $to_plot[$_][2]) {
$start[$_] = ceil($to_plot[$_][2] / $interval) * $interval;
} else {
$start[$_] = $start;
}
}
my $prev_time = 0; my $prev_time = 0;
my @prev_data = map {0} @idxs; my @prev_data = map {0} @idxs;
my @total_so_far = map {0} @idxs; my @total_so_far = map {0} @idxs;
...@@ -52,6 +61,11 @@ sub sum_usage_stats ($) { ...@@ -52,6 +61,11 @@ sub sum_usage_stats ($) {
return @res; return @res;
} }
sub filter_w_start ($@) {
my $time = shift @_;
return map {$time >= $start[$_] ? $_[$_] : 'NaN'} @idxs;
}
while (<F>) { while (<F>) {
chop; chop;
s/^(\d+) (\d+) // or die; s/^(\d+) (\d+) // or die;
...@@ -99,6 +113,8 @@ while (<F>) { ...@@ -99,6 +113,8 @@ while (<F>) {
} }
my @alloc = map {$num[$_] - $free[$_]} @idxs; my @alloc = map {$num[$_] - $free[$_]} @idxs;
my $dtime = $next_cutoff - $interval; my $dtime = $next_cutoff - $interval;
@free = filter_w_start $dtime, @free;
@alloc = filter_w_start $dtime, @alloc;
print O join(' ', $dtime, map {sprintf("%.1f", $_)} (@free, @alloc)),"\n" print O join(' ', $dtime, map {sprintf("%.1f", $_)} (@free, @alloc)),"\n"
if $dtime >= $start; if $dtime >= $start;
$error_frac = 0; $error_frac = 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment