(control) Add a summary table for Actors in the Node overview

This commit is contained in:
Viktor Lofgren 2024-01-12 16:32:15 +01:00
parent 56d832d661
commit 98c0972619
6 changed files with 38 additions and 5 deletions

View File

@ -14,7 +14,7 @@ public record ActorRunState(String name,
public String stateIcon() {
if (terminal) {
return "\uD83D\uDE34";
return "\uD83D\uDC80"; // Unicode Skull
}
else if (state.equals("MONITOR")) {
return "\uD83D\uDD26";

View File

@ -319,12 +319,18 @@ public class ControlNodeService {
private Object nodeOverviewModel(Request request, Response response) throws SQLException {
int nodeId = Integer.parseInt(request.params("id"));
var config = nodeConfigurationService.get(nodeId);
var actors = executorClient.getActorStates(Context.fromRequest(request), nodeId).states();
actors.removeIf(actor -> actor.state().equals("MONITOR"));
return Map.of(
"node", new IndexNode(nodeId),
"status", getStatus(config),
"events", getEvents(nodeId),
"processes", heartbeatService.getProcessHeartbeatsForNode(nodeId),
"jobs", heartbeatService.getTaskHeartbeatsForNode(nodeId),
"actors", actors,
"tab", Map.of("overview", true)
);
}

View File

@ -11,6 +11,7 @@
<div class="mt-2">
{{> control/partials/processes-table }}
{{> control/partials/actor-summary-table }}
</div>
<div class="mt-2">
{{> control/partials/events-table-summary }}
@ -21,7 +22,7 @@
{{> control/partials/foot-includes }}
<script>
window.setInterval(() => {
refresh(["processes", "jobs", "events"]);
refresh(["processes", "jobs", "events", "actors"]);
}, 2000);
</script>
</html>

View File

@ -15,8 +15,14 @@
{{#if nodes}}
<div class="my-3 p-3 border bg-light">
Index nodes are processing units. The search engine requires at least one, but more can be added
to spread the system load across multiple physical disks or even multiple servers.
<p>
Index nodes are processing units. The search engine requires at least one, but more can be added
to spread the system load across multiple physical disks or even multiple servers.
</p>
<p>
New index nodes register themselves automatically upon start-up. They can't be fully removed,
but can be disabled in the settings.
</p>
</div>
<table class="table">

View File

@ -0,0 +1,20 @@
<h2>Actor Summary</h2>
<small class="text-muted">Idle monitoring actors are hidden. See the <a href="/nodes/{{node.id}}/actors">Actors tab</a>
for a complete view.</small>
<table id="actors" class="table">
<tr>
<th>Actor</th>
<th>State</th>
</tr>
{{#each actors}}
<tr>
<td title="{{actorDescription}}">{{name}}</td>
<td title="{{stateDescription}}">{{stateIcon}}&nbsp;{{state}}</td>
</tr>
{{/each}}
{{#unless actors}}
<tr>
<td colspan="2">No activity</td>
</tr>
{{/unless}}
</table>

View File

@ -52,4 +52,4 @@
<td colspan="4">No jobs running lately</td>
</tr>
{{/unless}}
</table>
</table>