| 1 | import { SAMPLE_EVERY, type SystemStatsHistory } from "@/hooks/use-system-stats"; |
| 2 | |
| 3 | export const GB = |
| 4 | export const MB = |
| 5 | |
| 6 | export function timeLabel(originalIndex |
| 7 | const msAgo = |
| 8 | return new Date |
| 9 | } |
| 10 | |
| 11 | export type SeriesSpec |
| 12 | |
| 13 | export function buildRows(series |
| 14 | const src = |
| 15 | if (src.length |
| 16 | const stride = |
| 17 | const rows: |
| 18 | for (let i |
| 19 | const row: |
| 20 | for (const s |
| 21 | rows.push(row |
| 22 | } |
| 23 | return rows; |
| 24 | } |
| 25 | |
| 26 | export const fmtGb = |
| 27 | export const fmtMbps = |
| 28 | export const fmtPct = |
| 29 | |
| 30 | export function formatUptime(seconds |
| 31 | const unit = |
| 32 | new Intl.NumberFormat |
| 33 | const days = |
| 34 | const hours = |
| 35 | const minutes = |
| 36 | if (days > |
| 37 | if (hours > |
| 38 | return unit(minutes |
| 39 | } |