more succint proctitles
This commit is contained in:
@@ -59,7 +59,7 @@ my $tmp_dir = ($ENV{NETDISCO_TEMP} || dir($home, 'tmp'));
|
||||
mkdir $tmp_dir if ! -d $tmp_dir;
|
||||
|
||||
# process-table text
|
||||
prctl 'netdisco-backend: master';
|
||||
prctl 'nd2: master';
|
||||
|
||||
# shared local job queue
|
||||
my $queue = MCE::Queue->new;
|
||||
@@ -85,7 +85,7 @@ sub _mk_wkr {
|
||||
my $self = shift;
|
||||
$self->{queue} = $queue;
|
||||
|
||||
prctl sprintf 'netdisco-backend: worker #%s %s: init', MCE->wid, lc($role);
|
||||
prctl sprintf 'nd2: #%s %s: init', MCE->wid, lc($role);
|
||||
info sprintf 'applying role %s to worker %s', $role, MCE->wid;
|
||||
|
||||
# post-fork, become manager, scheduler, poller, etc
|
||||
|
||||
@@ -18,7 +18,7 @@ sub worker_body {
|
||||
my $wid = $self->wid;
|
||||
|
||||
while (1) {
|
||||
prctl sprintf 'netdisco-backend: worker #%s poller: idle', $wid;
|
||||
prctl sprintf 'nd2: #%s poll: idle', $wid;
|
||||
|
||||
my $job = $self->{queue}->dequeue(1);
|
||||
next unless defined $job;
|
||||
@@ -26,7 +26,7 @@ sub worker_body {
|
||||
|
||||
try {
|
||||
$job->started(scalar localtime);
|
||||
prctl sprintf 'netdisco-backend: worker #%s poller: working on #%s: %s',
|
||||
prctl sprintf 'nd2: #%s poll: #%s: %s',
|
||||
$wid, $job->job, $job->summary;
|
||||
info sprintf "pol (%s): starting %s job(%s) at %s",
|
||||
$wid, $action, $job->job, $job->started;
|
||||
@@ -50,8 +50,6 @@ sub close_job {
|
||||
my ($self, $job) = @_;
|
||||
my $now = scalar localtime;
|
||||
|
||||
prctl sprintf 'netdisco-backend: worker #%s poller: wrapping up %s #%s: %s',
|
||||
$self->wid, $job->action, $job->job, $job->status;
|
||||
info sprintf "pol (%s): wrapping up %s job(%s) - status %s at %s",
|
||||
$self->wid, $job->action, $job->job, $job->status, $now;
|
||||
|
||||
|
||||
@@ -39,12 +39,12 @@ sub worker_body {
|
||||
my $wid = $self->wid;
|
||||
|
||||
if (setting('workers')->{'no_manager'}) {
|
||||
prctl sprintf 'netdisco-backend: worker #%s manager: inactive', $wid;
|
||||
prctl sprintf 'nd2: #%s mgr: inactive', $wid;
|
||||
return debug "mgr ($wid): no need for manager... quitting"
|
||||
}
|
||||
|
||||
while (1) {
|
||||
prctl sprintf 'netdisco-backend: worker #%s manager: gathering', $wid;
|
||||
prctl sprintf 'nd2: #%s mgr: gathering', $wid;
|
||||
my $num_slots = 0;
|
||||
|
||||
$num_slots = parse_max_workers( setting('workers')->{tasks} )
|
||||
@@ -82,7 +82,7 @@ sub worker_body {
|
||||
}
|
||||
|
||||
debug "mgr ($wid): sleeping now...";
|
||||
prctl sprintf 'netdisco-backend: worker #%s manager: idle', $wid;
|
||||
prctl sprintf 'nd2: #%s mgr: idle', $wid;
|
||||
sleep( setting('workers')->{sleep_time} || 1 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ sub worker_body {
|
||||
my $wid = $self->wid;
|
||||
|
||||
unless (setting('schedule')) {
|
||||
prctl sprintf 'netdisco-backend: worker #%s scheduler: inactive', $wid;
|
||||
prctl sprintf 'nd2: #%s sched: inactive', $wid;
|
||||
return debug "sch ($wid): no need for scheduler... quitting"
|
||||
}
|
||||
|
||||
@@ -47,11 +47,11 @@ sub worker_body {
|
||||
# sleep until some point in the next minute
|
||||
my $naptime = 60 - (time % 60) + int(rand(45));
|
||||
|
||||
prctl sprintf 'netdisco-backend: worker #%s scheduler: idle', $wid;
|
||||
prctl sprintf 'nd2: #%s sched: idle', $wid;
|
||||
debug "sched ($wid): sleeping for $naptime seconds";
|
||||
|
||||
sleep $naptime;
|
||||
prctl sprintf 'netdisco-backend: worker #%s scheduler: queueing', $wid;
|
||||
prctl sprintf 'nd2: #%s sched: queueing', $wid;
|
||||
|
||||
# NB next_time() returns the next *after* win_start
|
||||
my $win_start = time - (time % 60) - 1;
|
||||
|
||||
Reference in New Issue
Block a user