Skip to content

Commit

Permalink
[backend] write hint about suppressed lastevent lines
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Feb 15, 2016
1 parent d3ea4cf commit 8cd3fbe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/backend/bs_serverstatus
Expand Up @@ -59,11 +59,15 @@ if (-S $ARGV[0]) {
delete $slots{$_} unless $jobs{$_};
}
# create slots
my $lasteventscount = 0;
my @slots;
for my $job (@{($ajaxstatus->{'joblist'} || {})->{'job'} || []}) {
my $id = $job->{'ev'};
next if $id == $ajaxstatus->{'ev'};
next if $nolastevents && $job->{'request'} && $job->{'request'} =~ /^GET \/lastevents\?/;
if ($nolastevents && $job->{'request'} && $job->{'request'} =~ /^GET \/lastevents\?/) {
$lasteventscount++;
next;
}
my $slot = $slots{$id};
if (!defined $slot) {
$slot = 0;
Expand All @@ -78,6 +82,9 @@ if (-S $ARGV[0]) {
my $str = sprintf("%5d %5d %3d %s", $d, $id, $job->{'fd'}, substr($req, 0, 80));
$slots[$slot] = $str;
}
if ($nolastevents) {
unshift @slots, "suppressed lastevents: $lasteventscount";
}
if ($ajaxstatus->{'watcher'}) {
push @slots, undef;
for my $fw (@{$ajaxstatus->{'watcher'}}) {
Expand Down

0 comments on commit 8cd3fbe

Please sign in to comment.