feat(supercomputer,experimental): expand thermal, RAM, disk, paradox APIs
Thermal hottest peer and sample clear, RAM pool reset, disk stripe missing shards, paradox clock/merge helpers, mycelium top donors. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -90,6 +90,23 @@ class HyperP2PThermalGuard extends EventEmitter {
|
||||
return { cpu: this.cpuThreshold, ram: this.ramThreshold, tempC: this.tempThresholdC }
|
||||
}
|
||||
|
||||
clearSample (peerId) {
|
||||
return this._samples.delete(this._pid(peerId))
|
||||
}
|
||||
|
||||
hottestPeer () {
|
||||
let best = null
|
||||
for (const s of this._samples.values()) {
|
||||
const hot = s.cpuPct + s.ramPct + (s.tempC / 2)
|
||||
if (!best || hot > best.hot) best = { peerId: s.peerId, hot, sample: s }
|
||||
}
|
||||
return best
|
||||
}
|
||||
|
||||
sampleCount () {
|
||||
return this._samples.size
|
||||
}
|
||||
|
||||
async ready () {
|
||||
if (this.swarm || !this.topic) return this
|
||||
await initModuleSwarm(this, {
|
||||
|
||||
Reference in New Issue
Block a user