fix a typo on printing

add a debug command (cores) that shows explicitly each core known by
the core system, including idle cores (available) and "behind the scene"
stuff (ssh masters)
This commit is contained in:
espie 2020-03-31 11:13:14 +00:00
parent a380cacf7b
commit 29cc19fdac
2 changed files with 23 additions and 3 deletions

View File

@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
# $OpenBSD: Core.pm,v 1.100 2019/10/22 15:44:10 espie Exp $
# $OpenBSD: Core.pm,v 1.101 2020/03/31 11:13:14 espie Exp $
#
# Copyright (c) 2010-2013 Marc Espie <espie@openbsd.org>
#
@ -464,6 +464,24 @@ my %stopped = ();
my $logdir;
my $lastcount = 0;
sub stats
{
my ($class, $fh, $state) = @_;
$fh->print("Available:\n");
for my $c (@$available) {
$fh->print(" ", $c->hostname, "\n");
}
my $msg = "Running";
my $current = Time::HiRes::time();
for my $repo ($class->repositories) {
$fh->print("$msg:\n");
while (my ($k, $c) = each %$repo) {
$fh->print(" ", one_core($c, $current), "\n");
}
$msg = "Special";
}
}
sub log_concurrency
{
my ($class, $time, $fh) = @_;

View File

@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
# $OpenBSD: External.pm,v 1.23 2019/10/27 09:21:11 espie Exp $
# $OpenBSD: External.pm,v 1.24 2020/03/31 11:13:14 espie Exp $
#
# Copyright (c) 2017 Marc Espie <espie@openbsd.org>
#
@ -109,7 +109,7 @@ sub wipe
if (!defined $h) {
$fh->print("Can't wipe on $info->{host}: no such host\n");
} elsif (!$h->is_alive) {
$h->print("Can't wipe on $info->{host}: host is AWOL\n");
$fh->print("Can't wipe on $info->{host}: host is AWOL\n");
} else {
$fh->print("cleaning up $info->{locked}\n");
my $w = DPB::PkgPath->new($info->{locked});
@ -174,6 +174,8 @@ sub handle_command
}
} elsif ($line =~ m/^stats\b/) {
$fh->print($state->engine->statline, "\n");
} elsif ($line =~ m/^cores\b/) {
DPB::Core->stats($fh, $state);
} elsif ($line =~ m/^status\s+(.*)/) {
for my $p (split(/\s+/, $1)) {
my $v = DPB::PkgPath->new($p);