Buckets:
| 'use client'; | |
| import useMonitorStream from '@/hooks/useMonitorStream'; | |
| /** | |
| * CPU stats from the shared /api/monitor SSE stream. Data arrives live every | |
| * MONITOR_TICK_MS, so `reloadInterval` is accepted only for call-site | |
| * compatibility with the old polling implementation and is ignored. | |
| */ | |
| export default function useCPUInfo(reloadInterval: null | number = null) { | |
| void reloadInterval; | |
| const { cpu, connected } = useMonitorStream(); | |
| const isCPUInfoLoaded = cpu !== null; | |
| const status: 'idle' | 'loading' | 'success' | 'error' = cpu !== null ? 'success' : connected ? 'loading' : 'idle'; | |
| return { | |
| cpuInfo: cpu, | |
| isCPUInfoLoaded, | |
| status, | |
| // The stream is always live; nothing to refresh manually. | |
| refreshCpuInfo: async () => {}, | |
| }; | |
| } | |
Xet Storage Details
- Size:
- 774 Bytes
- Xet hash:
- 0287d1af334e97fbb0661799995c68f923e3ea52f2c739efba1c3b4d7ce7cf75
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.