Compare commits
No commits in common. "48c379dc88869606ef5c5ce05ca83d896f91c018" and "2fe3d5b932ec70621730cbb7600967db82368f6b" have entirely different histories.
48c379dc88
...
2fe3d5b932
@ -16,7 +16,7 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: atlasbot
|
app: atlasbot
|
||||||
annotations:
|
annotations:
|
||||||
checksum/atlasbot-configmap: manual-atlasbot-87
|
checksum/atlasbot-configmap: manual-atlasbot-86
|
||||||
vault.hashicorp.com/agent-inject: "true"
|
vault.hashicorp.com/agent-inject: "true"
|
||||||
vault.hashicorp.com/role: "comms"
|
vault.hashicorp.com/role: "comms"
|
||||||
vault.hashicorp.com/agent-inject-secret-turn-secret: "kv/data/atlas/comms/turn-shared-secret"
|
vault.hashicorp.com/agent-inject-secret-turn-secret: "kv/data/atlas/comms/turn-shared-secret"
|
||||||
|
|||||||
@ -1145,33 +1145,6 @@ def facts_context(
|
|||||||
rate=metric in ("net", "io"),
|
rate=metric in ("net", "io"),
|
||||||
)
|
)
|
||||||
lines.append(f"- lowest_{metric}: {node} ({value_fmt})")
|
lines.append(f"- lowest_{metric}: {node} ({value_fmt})")
|
||||||
for metric in ("cpu", "ram"):
|
|
||||||
hottest_parts: list[str] = []
|
|
||||||
lowest_parts: list[str] = []
|
|
||||||
for hw, nodes_list in sorted(by_hardware.items()):
|
|
||||||
entries = []
|
|
||||||
for entry in usage_table:
|
|
||||||
node = entry.get("node")
|
|
||||||
if node in nodes_list and entry.get(metric) is not None:
|
|
||||||
try:
|
|
||||||
value = float(entry.get(metric))
|
|
||||||
except (TypeError, ValueError):
|
|
||||||
continue
|
|
||||||
entries.append((node, value))
|
|
||||||
if not entries:
|
|
||||||
continue
|
|
||||||
max_node, max_val = max(entries, key=lambda item: item[1])
|
|
||||||
min_node, min_val = min(entries, key=lambda item: item[1])
|
|
||||||
hottest_parts.append(
|
|
||||||
f"{hw}={max_node} ({_format_metric_value(str(max_val), percent=True)})"
|
|
||||||
)
|
|
||||||
lowest_parts.append(
|
|
||||||
f"{hw}={min_node} ({_format_metric_value(str(min_val), percent=True)})"
|
|
||||||
)
|
|
||||||
if hottest_parts:
|
|
||||||
lines.append(f"- hottest_{metric}_by_hardware: {', '.join(hottest_parts)}")
|
|
||||||
if lowest_parts:
|
|
||||||
lines.append(f"- lowest_{metric}_by_hardware: {', '.join(lowest_parts)}")
|
|
||||||
|
|
||||||
if nodes_in_query:
|
if nodes_in_query:
|
||||||
lines.append("- node_details:")
|
lines.append("- node_details:")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user