Compare commits
2 Commits
2fe3d5b932
...
48c379dc88
| Author | SHA1 | Date | |
|---|---|---|---|
| 48c379dc88 | |||
| 6001876409 |
@ -16,7 +16,7 @@ spec:
|
||||
labels:
|
||||
app: atlasbot
|
||||
annotations:
|
||||
checksum/atlasbot-configmap: manual-atlasbot-86
|
||||
checksum/atlasbot-configmap: manual-atlasbot-87
|
||||
vault.hashicorp.com/agent-inject: "true"
|
||||
vault.hashicorp.com/role: "comms"
|
||||
vault.hashicorp.com/agent-inject-secret-turn-secret: "kv/data/atlas/comms/turn-shared-secret"
|
||||
|
||||
@ -1145,6 +1145,33 @@ def facts_context(
|
||||
rate=metric in ("net", "io"),
|
||||
)
|
||||
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:
|
||||
lines.append("- node_details:")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user