mirror of
https://github.com/zvx-echo6/meshai.git
synced 2026-06-10 17:04:45 +02:00
Merge branch 'feature/mesh-intelligence'
This commit is contained in:
commit
ea5b6f5306
1 changed files with 24 additions and 10 deletions
|
|
@ -126,14 +126,28 @@ class MeshAI:
|
||||||
if self.broadcaster and self.health_engine.mesh_health:
|
if self.broadcaster and self.health_engine.mesh_health:
|
||||||
try:
|
try:
|
||||||
mh = self.health_engine.mesh_health
|
mh = self.health_engine.mesh_health
|
||||||
|
sc = mh.score
|
||||||
|
if sc.composite > 0 and sc.infra_total > 0:
|
||||||
health_dict = {
|
health_dict = {
|
||||||
"score": round(mh.score.composite, 1),
|
"score": round(sc.composite, 1),
|
||||||
"tier": mh.score.tier,
|
"tier": sc.tier,
|
||||||
|
"pillars": {
|
||||||
|
"infrastructure": round(sc.infrastructure, 1),
|
||||||
|
"utilization": round(sc.utilization, 1),
|
||||||
|
"coverage": round(sc.coverage, 1),
|
||||||
|
"behavior": round(sc.behavior, 1),
|
||||||
|
"power": round(sc.power, 1),
|
||||||
|
},
|
||||||
|
"infra_online": sc.infra_online,
|
||||||
|
"infra_total": sc.infra_total,
|
||||||
|
"util_percent": round(sc.util_percent, 1),
|
||||||
|
"flagged_nodes": sc.flagged_nodes,
|
||||||
|
"battery_warnings": sc.battery_warnings,
|
||||||
"total_nodes": mh.total_nodes,
|
"total_nodes": mh.total_nodes,
|
||||||
"total_regions": mh.total_regions,
|
"total_regions": mh.total_regions,
|
||||||
"infra_online": mh.score.infra_online,
|
"unlocated_count": getattr(mh, "unlocated_count", 0),
|
||||||
"infra_total": mh.score.infra_total,
|
|
||||||
"last_computed": mh.last_computed,
|
"last_computed": mh.last_computed,
|
||||||
|
"recommendations": getattr(mh, "recommendations", []),
|
||||||
}
|
}
|
||||||
await self.broadcaster.broadcast("health_update", health_dict)
|
await self.broadcaster.broadcast("health_update", health_dict)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue