Function
buildLatencies
(
proxies: TypesGen.WorkspaceProxy[],
)
Source from the content-addressed store, hash-verified
| 37 | }; |
| 38 | |
| 39 | const 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 | |
| 60 | const manyProxies = buildProxies(45); |
| 61 | |
Tested by
no test coverage detected