diff --git a/igor-web/src/main/groovy/com/netflix/spinnaker/igor/config/EchoConfig.groovy b/igor-web/src/main/groovy/com/netflix/spinnaker/igor/config/EchoConfig.groovy index afac09f9c..d7a44507c 100644 --- a/igor-web/src/main/groovy/com/netflix/spinnaker/igor/config/EchoConfig.groovy +++ b/igor-web/src/main/groovy/com/netflix/spinnaker/igor/config/EchoConfig.groovy @@ -46,7 +46,7 @@ class EchoConfig { new RestAdapter.Builder() .setEndpoint(Endpoints.newFixedEndpoint(address)) .setClient(new OkClient(okHttpClientConfig.create())) - .setLogLevel(RestAdapter.LogLevel.BASIC) + .setLogLevel(RestAdapter.LogLevel.NONE) .build() .create(EchoService) diff --git a/igor-web/src/main/groovy/com/netflix/spinnaker/igor/config/JenkinsConfig.groovy b/igor-web/src/main/groovy/com/netflix/spinnaker/igor/config/JenkinsConfig.groovy index de5703189..ebdf416a4 100644 --- a/igor-web/src/main/groovy/com/netflix/spinnaker/igor/config/JenkinsConfig.groovy +++ b/igor-web/src/main/groovy/com/netflix/spinnaker/igor/config/JenkinsConfig.groovy @@ -19,6 +19,7 @@ package com.netflix.spinnaker.igor.config import com.netflix.spinnaker.igor.jenkins.client.JenkinsClient import com.netflix.spinnaker.igor.jenkins.service.JenkinsService import com.netflix.spinnaker.igor.service.BuildMasters +import com.squareup.okhttp.ConnectionPool import com.squareup.okhttp.Credentials import com.squareup.okhttp.OkHttpClient import groovy.transform.CompileStatic @@ -71,6 +72,7 @@ class JenkinsConfig { static JenkinsClient jenkinsClient(String address, String username, String password, int timeout = 30000) { OkHttpClient client = new OkHttpClient() client.setReadTimeout(timeout, TimeUnit.MILLISECONDS) + client.setConnectionPool(new ConnectionPool(0, 5 * 60 * 1000)); new RestAdapter.Builder() .setEndpoint(Endpoints.newFixedEndpoint(address)) diff --git a/igor-web/src/main/groovy/com/netflix/spinnaker/igor/jenkins/JenkinsBuildMonitor.groovy b/igor-web/src/main/groovy/com/netflix/spinnaker/igor/jenkins/JenkinsBuildMonitor.groovy index 8ae5905d0..47d0f1300 100644 --- a/igor-web/src/main/groovy/com/netflix/spinnaker/igor/jenkins/JenkinsBuildMonitor.groovy +++ b/igor-web/src/main/groovy/com/netflix/spinnaker/igor/jenkins/JenkinsBuildMonitor.groovy @@ -140,12 +140,16 @@ class JenkinsBuildMonitor implements PollingMonitor { log.info('Checking for new builds for ' + master) List results = [] + lastPoll = System.currentTimeMillis() + long thisPoll = lastPoll try { - lastPoll = System.currentTimeMillis() List cachedBuilds = cache.getJobNames(master) def startTime = System.currentTimeMillis() List builds = buildMasters.map[master].projects?.list + + log.info( "finding new builds in ${master} : ${ builds.size() } items" ) + log.info("Took ${System.currentTimeMillis() - startTime}ms to retrieve projects (master: ${master})") List buildNames = builds*.name @@ -234,7 +238,7 @@ class JenkinsBuildMonitor implements PollingMonitor { log.error("failed to update master $master", e) } - log.info("Last poll took ${System.currentTimeMillis() - lastPoll}ms (master: ${master})") + log.info("Last poll took ${System.currentTimeMillis() - thisPoll}ms (master: ${master})") results }