MCPcopy Create free account
hub / github.com/coder/coder / updateStoredLatencies

Function updateStoredLatencies

site/src/contexts/useProxyLatency.ts:276–283  ·  view source on GitHub ↗
(action: ProxyLatencyAction)

Source from the content-addressed store, hash-verified

274};
275
276const updateStoredLatencies = (action: ProxyLatencyAction): void => {
277 const latencies = loadStoredLatencies();
278 const reports = latencies[action.proxyID] || [];
279
280 reports.push(action.report);
281 latencies[action.proxyID] = reports;
282 localStorage.setItem("workspace-proxy-latencies", JSON.stringify(latencies));
283};
284
285// garbageCollectStoredLatencies will remove any latencies that are older then 1 week or latencies of proxies
286// that no longer exist. This is intended to keep the size of local storage down.

Callers 1

Calls 2

loadStoredLatenciesFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected