Skip to content

Commit

Permalink
added cpu mem usage warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vpalmisano committed Sep 16, 2024
1 parent 0ae8607 commit 41847b4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,16 @@ window.SERVER_USE_HTTPS = ${this.serverUseHttps};
collectedStats.usedCpu = systemStats.usedCpu
collectedStats.usedMemory = systemStats.usedMemory
collectedStats.usedGpu = systemStats.usedGpu
if (collectedStats.usedCpu > 0.8) {
log.warn(
`High system CPU usage: ${collectedStats.usedCpu.toFixed(2)}%`,
)
}
if (collectedStats.usedMemory > 0.8) {
log.warn(
`High system memory usage: ${collectedStats.usedMemory.toFixed(2)}%`,
)
}
}
} catch (err) {
log.error(`node getSystemStats error: ${(err as Error).stack}`)
Expand Down

0 comments on commit 41847b4

Please sign in to comment.