MCPcopy Create free account
hub / github.com/dwgx/WindsurfAPI / getRpmStats

Function getRpmStats

src/auth.js:965–974  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

963 * Snapshot of per-account RPM usage, for dashboard display.
964 */
965export 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.

Callers 1

rate-limit.test.jsFile · 0.90

Calls 2

rpmLimitForFunction · 0.85
pruneRpmHistoryFunction · 0.85

Tested by

no test coverage detected