Merge branch 'master' into fix/useless-message
This commit is contained in:
@@ -110,6 +110,7 @@ let
|
||||
NetAmazonS3
|
||||
NetPrometheus
|
||||
NetStatsd
|
||||
NumberBytesHuman
|
||||
PadWalker
|
||||
ParallelForkManager
|
||||
PerlCriticCommunity
|
||||
|
@@ -9,6 +9,7 @@ use Hydra::Helper::CatalystUtils;
|
||||
use Hydra::View::TT;
|
||||
use Nix::Store;
|
||||
use Nix::Config;
|
||||
use Number::Bytes::Human qw(format_bytes);
|
||||
use Encode;
|
||||
use File::Basename;
|
||||
use JSON::MaybeXS;
|
||||
@@ -200,9 +201,11 @@ sub machines :Local Args(0) {
|
||||
my $ms = decode_json($status->status)->{"machines"};
|
||||
foreach my $name (keys %{$ms}) {
|
||||
$name = "" if $name eq "localhost";
|
||||
$machines->{$name} //= {disabled => 1};
|
||||
$machines->{$name}->{nrStepsDone} = $ms->{$name}->{nrStepsDone};
|
||||
$machines->{$name}->{avgStepBuildTime} = $ms->{$name}->{avgStepBuildTime} // 0;
|
||||
my $outName = $name;
|
||||
$outName = "" if $name eq "ssh://localhost";
|
||||
$machines->{$outName} //= {disabled => 1};
|
||||
$machines->{$outName}->{nrStepsDone} = $ms->{$name}->{nrStepsDone};
|
||||
$machines->{$outName}->{avgStepBuildTime} = $ms->{$name}->{avgStepBuildTime} // 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,6 +218,19 @@ sub machines :Local Args(0) {
|
||||
"where busy != 0 order by machine, stepnr",
|
||||
{ Slice => {} });
|
||||
$c->stash->{template} = 'machine-status.tt';
|
||||
$c->stash->{human_bytes} = sub {
|
||||
my ($bytes) = @_;
|
||||
return format_bytes($bytes, si => 1);
|
||||
};
|
||||
$c->stash->{pretty_load} = sub {
|
||||
my ($load) = @_;
|
||||
return sprintf('%.2f', $load);
|
||||
};
|
||||
$c->stash->{pretty_percent} = sub {
|
||||
my ($percent) = @_;
|
||||
my $ret = sprintf('%.2f', $percent);
|
||||
return (' ' x (6 - length($ret))) . $ret;
|
||||
};
|
||||
$self->status_ok($c, entity => $c->stash->{machines});
|
||||
}
|
||||
|
||||
|
@@ -363,6 +363,14 @@ sub getMachines {
|
||||
, speedFactor => $machine->{speedFactor}
|
||||
, supportedFeatures => [ @{$machine->{supportedFeatures}}, @{$machine->{mandatoryFeatures}} ]
|
||||
, mandatoryFeatures => [ @{$machine->{mandatoryFeatures}} ]
|
||||
# New fields for the machine status
|
||||
, primarySystemType => $machine->{systems}[0]
|
||||
, hasCapacity => $machine->{hasCapacity}
|
||||
, hasDynamicCapacity => $machine->{hasDynamicCapacity}
|
||||
, hasStaticCapacity => $machine->{hasStaticCapacity}
|
||||
, score => $machine->{score}
|
||||
, stats => $machine->{stats}
|
||||
, memTotal => $machine->{totalMem}
|
||||
};
|
||||
}
|
||||
} else {
|
||||
|
@@ -685,6 +685,14 @@ BLOCK includeFlot %]
|
||||
[% END;
|
||||
|
||||
|
||||
BLOCK renderYesNo %]
|
||||
[% IF value %]
|
||||
<span class="text-success">Yes</span>
|
||||
[% ELSE %]
|
||||
<span class="text-danger">No</span>
|
||||
[% END %]
|
||||
[% END;
|
||||
|
||||
BLOCK createChart %]
|
||||
|
||||
<div id="[%id%]-chart" style="width: 1000px; height: 400px;"></div>
|
||||
|
@@ -19,10 +19,46 @@
|
||||
<tr>
|
||||
<th colspan="7">
|
||||
<tt [% IF m.value.disabled %]style="text-decoration: line-through;"[% END %]>[% INCLUDE renderMachineName machine=m.key %]</tt>
|
||||
[% IF m.value.systemTypes %]
|
||||
[% IF m.value.primarySystemType %]
|
||||
<span class="muted" style="font-weight: normal;">
|
||||
([% comma=0; FOREACH system IN m.value.systemTypes %][% IF comma; %], [% ELSE; comma = 1; END %]<tt>[% system %]</tt>[% END %])
|
||||
(<tt>[% m.value.primarySystemType %]</tt>)
|
||||
</span>
|
||||
|
||||
[% WRAPPER makePopover title="Details" classes="btn-secondary btn-sm" %]
|
||||
<ul class="list-unstyled mb-0">
|
||||
<li><b>System types: </b>[% comma=0; FOREACH system IN m.value.systemTypes %][% IF comma; %], [% ELSE; comma = 1; END %]<tt>[% system %]</tt>[% END %]</li>
|
||||
<li><b>Supported Features: </b>[% comma=0; FOREACH feat IN m.value.supportedFeatures %][% IF comma; %], [% ELSE; comma = 1; END %]<tt>[% feat %]</tt>[% END %]</li>
|
||||
<li><b>Mandatory Features: </b>[% comma=0; FOREACH feat IN m.value.mandatoryFeatures %][% IF comma; %], [% ELSE; comma = 1; END %]<tt>[% feat %]</tt>[% END %]</li>
|
||||
<li><b>Capacity: </b>[% INCLUDE renderYesNo value=m.value.hasCapacity %] <b>Static: </b>[% INCLUDE renderYesNo value=m.value.hasStaticCapacity %] <b>Dynamic: </b>[% INCLUDE renderYesNo value=m.value.hasDynamicCapacity %]</li>
|
||||
<li><b>Scheduling Score: </b>[% m.value.score %]</li>
|
||||
<li><b>Load: </b><tt>[% pretty_load(m.value.stats.load1) %]</tt> <tt>[% pretty_load(m.value.stats.load5) %]</tt> <tt>[% pretty_load(m.value.stats.load15) %]</tt></li>
|
||||
<li><b>Memory: </b><tt>[% human_bytes(m.value.stats.memUsage) %]</tt> of <tt>[% human_bytes(m.value.memTotal) %]</tt> used (<tt>[% human_bytes(m.value.memTotal - m.value.stats.memUsage) %]</tt> free)</li>
|
||||
[% pressure = m.value.stats.pressure %]
|
||||
[% MACRO render_pressure(title, pressure) BLOCK %]
|
||||
[% IF pressure %]
|
||||
<tr><td><b>[% title %]:</b></td><td><tt>[% pretty_percent(pressure.avg10) %]%</tt></td><td><td><tt>[% pretty_percent(pressure.avg60) %]%</tt></td><td><td><tt>[% pretty_percent(pressure.avg300) %]%</tt></td><td>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% IF pressure %]
|
||||
<li><b>Pressure: </b>
|
||||
<table class="pressureTable">
|
||||
[% render_pressure('Some CPU', pressure.cpuSome) %]
|
||||
[% render_pressure('Some IO', pressure.ioSome) %]
|
||||
[% render_pressure('Full IO', pressure.ioFull) %]
|
||||
[% render_pressure('Full IRQ', pressure.irqFull) %]
|
||||
[% render_pressure('Some Memory', pressure.memSome) %]
|
||||
[% render_pressure('Full Memory', pressure.memFull) %]
|
||||
</table>
|
||||
</li>
|
||||
[% END %]
|
||||
</ul>
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
[% IF m.value.systemTypes %]
|
||||
<span class="muted" style="font-weight: normal;">
|
||||
([% comma=0; FOREACH system IN m.value.systemTypes %][% IF comma; %], [% ELSE; comma = 1; END %]<tt>[% system %]</tt>[% END %])
|
||||
</span>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% IF m.value.nrStepsDone %]
|
||||
<span class="muted" style="font-weight: normal;">
|
||||
|
@@ -181,6 +181,14 @@ a.squiggle:hover {
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
|
||||
table.pressureTable {
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
table.pressureTable td {
|
||||
padding: 0 .4em;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
/* Prevent some flickering */
|
||||
html {
|
||||
|
Reference in New Issue
Block a user