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

Function buildLatencies

site/src/modules/dashboard/Navbar/ProxyMenu.stories.tsx:39–58  ·  view source on GitHub ↗
(
	proxies: TypesGen.WorkspaceProxy[],
)

Source from the content-addressed store, hash-verified

37};
38
39const buildLatencies = (
40 proxies: TypesGen.WorkspaceProxy[],
41): typeof MockProxyLatencies => {
42 const latencies: typeof MockProxyLatencies = {};
43
44 for (const [index, proxy] of proxies.entries()) {
45 if (!proxy.healthy) {
46 continue;
47 }
48
49 latencies[proxy.id] = {
50 accurate: true,
51 latencyMS: 20 + index * 3,
52 at: new Date(),
53 nextHopProtocol: "h2",
54 };
55 }
56
57 return latencies;
58};
59
60const manyProxies = buildProxies(45);
61

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected