keep track of how long a job is stuck, max.
This commit is contained in:
parent
7222a75d55
commit
0a05d056a4
@ -1,5 +1,5 @@
|
||||
# ex:ts=8 sw=4:
|
||||
# $OpenBSD: Clock.pm,v 1.2 2011/06/04 12:58:24 espie Exp $
|
||||
# $OpenBSD: Clock.pm,v 1.3 2012/03/02 19:33:43 espie Exp $
|
||||
#
|
||||
# Copyright (c) 2011 Marc Espie <espie@openbsd.org>
|
||||
#
|
||||
@ -100,6 +100,7 @@ sub new
|
||||
expected => $expected,
|
||||
offset => $offset,
|
||||
time => $time,
|
||||
max => 0,
|
||||
}, $class;
|
||||
DPB::Clock->register($o);
|
||||
return $o;
|
||||
@ -119,7 +120,11 @@ sub check_change
|
||||
$self->{sz} = $sz;
|
||||
$self->{time} = $current;
|
||||
}
|
||||
return $current - $self->{time};
|
||||
my $d = $current - $self->{time};
|
||||
if ($d > $self->{max}) {
|
||||
$self->{max} = $d;
|
||||
}
|
||||
return $d;
|
||||
}
|
||||
|
||||
sub change_message
|
||||
|
@ -1,5 +1,5 @@
|
||||
# ex:ts=8 sw=4:
|
||||
# $OpenBSD: Port.pm,v 1.25 2011/12/05 21:27:53 espie Exp $
|
||||
# $OpenBSD: Port.pm,v 1.26 2012/03/02 19:33:43 espie Exp $
|
||||
#
|
||||
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
|
||||
#
|
||||
@ -590,7 +590,7 @@ sub totaltime
|
||||
sub timings
|
||||
{
|
||||
my $self = shift;
|
||||
return join('/', map {sprintf("%s=%.2f", $_->name, $_->elapsed)} @{$self->{done}});
|
||||
return join('/', "max_stuck=".$self->{watched}{max}, map {sprintf("%s=%.2f", $_->name, $_->elapsed)} @{$self->{done}});
|
||||
}
|
||||
|
||||
my $logsize = {};
|
||||
|
Loading…
Reference in New Issue
Block a user