MCPcopy Create free account
hub / github.com/Effect-TS/effect / targetSize

Function targetSize

packages/effect/src/Pool.ts:598–603  ·  view source on GitHub ↗
(self: Pool<A, E>)

Source from the content-addressed store, hash-verified

596}
597
598const targetSize = <A, E>(self: Pool<A, E>) => {
599 if (self.state.isShuttingDown) return 0
600 const utilization = currentUsage(self) / self.config.targetUtilization
601 const target = Math.ceil(utilization / self.config.concurrency)
602 return Math.min(Math.max(self.config.minSize, target), self.config.maxSize)
603}
604
605const activeSize = <A, E>(self: Pool<A, E>) => {
606 return self.state.items.size - self.state.invalidated.size

Callers 2

Pool.tsFile · 0.85
resizeLoopFunction · 0.85

Calls 1

currentUsageFunction · 0.85

Tested by

no test coverage detected