#---------- duration estimator ----------
-sub duration_estimator ($$;$$) {
- my ($branch, $blessing, $debug, $will_uptoincl_testid) = @_;
+sub duration_estimator ($$;$$$) {
+ my ($branch, $blessing, $debug, $will_uptoincl_testid, $our_memo) = @_;
# returns a function which you call like this
# $durest->($job, $hostidname, $onhost [, $uptoincl_testid])
# and returns one of
my $recentflights_q= $prepare_combi->($recentflights_qtxt);
my $duration_anyref_q= $prepare_combi->($duration_anyref_qtxt);
+ $our_memo //= { };
+
return sub {
my ($job, $hostidname, $onhost, $uptoincl_testid) = @_;
+ my $memokey = "$job $hostidname $onhost $uptoincl_testid";
+ my $memo = $our_memo->{$memokey};
+ return @$memo if $memo;
+
my @x_params;
push @x_params, $uptoincl_testid if $will_uptoincl_testid;
}
}
- return ($duration_max, $refs->[0]{started}, $refs->[0]{status});
+ $memo = [$duration_max, $refs->[0]{started}, $refs->[0]{status}];
+ $our_memo->{$memokey} = $memo;
+ return @$memo;
};
}