(self: Pool<A, E>)
| 596 | } |
| 597 | |
| 598 | const 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 | |
| 605 | const activeSize = <A, E>(self: Pool<A, E>) => { |
| 606 | return self.state.items.size - self.state.invalidated.size |
no test coverage detected