()
| 963 | * Snapshot of per-account RPM usage, for dashboard display. |
| 964 | */ |
| 965 | export function getRpmStats() { |
| 966 | const now = Date.now(); |
| 967 | const out = {}; |
| 968 | for (const a of accounts) { |
| 969 | const limit = rpmLimitFor(a); |
| 970 | const used = pruneRpmHistory(a, now); |
| 971 | out[a.id] = { used, limit, tier: a.tier || 'unknown' }; |
| 972 | } |
| 973 | return out; |
| 974 | } |
| 975 | |
| 976 | /** |
| 977 | * Ensure an LS instance exists for an account's proxy. |
no test coverage detected