package org.innovateuk.ifs.metrics;

import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ConnectionCountService {

    private final PoolingHttpClientConnectionManager connManager;

    @Autowired
    public ConnectionCountService(PoolingHttpClientConnectionManager connManager) {
        this.connManager = connManager;
    }

    public boolean connectionHealthy() {
        return 0 < connManager.getTotalStats().getAvailable();
    }

}

@@ -531,11 +531,117 @@
 urn 
-0 %3C
+connManager.getMaxTotal() %3E getUsedConnections();%0A    %7D%0A%0A    private int getUsedConnections()%7B%0A        return
  con
@@ -672,17 +672,14 @@
 .get
-Available
+Leased
 ();%0A

fix broken readinessCheck