code: private PoolStats getPoolStats()
     {
        return new PoolStats(SECONDS.toMillis(1)) {
           @Override
           protected void update() {
              this.pendingThreads = HikariPool.this.getThreadsAwaitingConnection();
              this.idleConnections = HikariPool.this.getIdleConnections();
              this.totalConnections = HikariPool.this.getTotalConnections();
              this.activeConnections = HikariPool.this.getActiveConnections();
              this.maxConnections = config.getMaximumPoolSize();
              this.minConnections = config.getMinimumIdle();
           }
        };
     }
docs: Create a PoolStats instance that will be used by metrics tracking, with a pollable resolution of 1 second.
  
  @return a PoolStats instance