```scala
private val connectionPoolSizeGauge = metrics,gauge("connection-pool-size") {
  connectionMap.size()
}
```

And you don't need that companion object :)