Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoscaling use adjusted total memory #80528

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private void retainAliveNodes(Set<DiscoveryNode> currentNodes) {
private void addNodeStats(ImmutableOpenMap.Builder<String, Long> builder, NodeStats nodeStats) {
// we might add nodes that already died here, but those will be removed on next cluster state update anyway and is only a small
// waste.
builder.put(nodeStats.getNode().getEphemeralId(), nodeStats.getOs().getMem().getTotal().getBytes());
builder.put(nodeStats.getNode().getEphemeralId(), nodeStats.getOs().getMem().getAdjustedTotal().getBytes());
}

public AutoscalingMemoryInfo snapshot() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public void assertMatchesResponse(Set<DiscoveryNode> nodes, NodesStatsResponse r
n -> {
assertThat(
service.snapshot().get(n),
equalTo(response.getNodesMap().get(n.getId()).getOs().getMem().getTotal().getBytes())
equalTo(response.getNodesMap().get(n.getId()).getOs().getMem().getAdjustedTotal().getBytes())
);
}
);
Expand All @@ -347,7 +347,7 @@ private static NodeStats statsForNode(DiscoveryNode node, long memory) {
OsStats osStats = new OsStats(
randomNonNegativeLong(),
new OsStats.Cpu(randomShort(), null),
new OsStats.Mem(memory, memory, randomLongBetween(0, memory)),
new OsStats.Mem(memory, randomLongBetween(0, memory), randomLongBetween(0, memory)),
new OsStats.Swap(randomNonNegativeLong(), randomNonNegativeLong()),
null
);
Expand Down