Skip to content

Commit

Permalink
(control) Add a summary table for Actors in the Node overview
Browse files Browse the repository at this point in the history
  • Loading branch information
vlofgren committed Jan 12, 2024
1 parent 56d832d commit 98c0972
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 5 deletions.
Expand Up @@ -14,7 +14,7 @@ public boolean isDaemon() {

public String stateIcon() {
if (terminal) {
return "\uD83D\uDE34";
return "\uD83D\uDC80"; // Unicode Skull
}
else if (state.equals("MONITOR")) {
return "\uD83D\uDD26";
Expand Down
Expand Up @@ -319,12 +319,18 @@ else if ("storage".equals(act)) {
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)
);
}
Expand Down
Expand Up @@ -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 }}
Expand All @@ -21,7 +22,7 @@
{{> control/partials/foot-includes }}
<script>
window.setInterval(() => {
refresh(["processes", "jobs", "events"]);
refresh(["processes", "jobs", "events", "actors"]);
}, 2000);
</script>
</html>
Expand Up @@ -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">
Expand Down
@@ -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>
Expand Up @@ -52,4 +52,4 @@
<td colspan="4">No jobs running lately</td>
</tr>
{{/unless}}
</table>
</table>

0 comments on commit 98c0972

Please sign in to comment.