Skip to content

Commit e5477ec

Browse files
feat: track peak RAM usage between heartbeats instead of point-in-time (#12)
Co-authored-by: craigbidenbot[bot] <craigbidenbot[bot]@users.noreply.github.com>
1 parent 16c1ae2 commit e5477ec

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

HEARTBEAT.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@ Silent. No Discord message.
1818

1919
## 2. Infrastructure Monitoring (every run)
2020

21-
Run `df -h /` and `free -m`. Also run `mcporter call x402 get_wallet_info` to check wallet balance. Only alert if:
21+
Run `df -h /` and `mcporter call x402 get_wallet_info` to check disk and wallet.
22+
23+
For RAM: read `/tmp/craig-ram-peak` which tracks the highest RAM % since last reset (sampled every 15s by `craig-ram-monitor.service`). After reading, reset it: `echo "0" > /tmp/craig-ram-peak`.
24+
25+
Only alert if:
2226
- Disk usage > 70%
23-
- RAM usage > 75%
27+
- Peak RAM usage > 75% (since last heartbeat)
2428
- x402 wallet balance < $2.00
2529

26-
If any threshold is breached: send one short message to Discord with the number(s). If all fine: say nothing.
30+
If any threshold is breached: send one short message to Discord with the number(s) and timestamp. If all fine: say nothing.
2731

2832
## 3. Email Check (once daily)
2933

0 commit comments

Comments
 (0)