Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

Commit

Permalink
Bugfix/2844 debug crawl jenkins (#63)
Browse files Browse the repository at this point in the history
* try to debug out crawling

* try to debug out crawling
  • Loading branch information
bjartek authored and bentsolheim committed Oct 2, 2018
1 parent 3a35adc commit 04ad2c6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 15 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Expand Up @@ -24,8 +24,8 @@ buildscript {
}

plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "org.jetbrains.kotlin.plugin.spring" version "1.2.60"
id "org.jetbrains.kotlin.jvm" version "1.2.71"
id "org.jetbrains.kotlin.plugin.spring" version "1.2.71"
id 'org.springframework.boot' version '2.0.4.RELEASE'
id 'org.jlleitschuh.gradle.ktlint' version '4.0.0'
}
Expand Down Expand Up @@ -64,15 +64,15 @@ def junitJupiterVersion = dependencyManagement.importedProperties['junit-jupiter
dependencies {

compile(
"org.jetbrains.kotlin:kotlin-reflect:1.2.60",
"org.jetbrains.kotlin:kotlin-reflect:1.2.71",
'org.jetbrains.kotlin:kotlin-stdlib-jdk8',
'com.fasterxml.jackson.module:jackson-module-kotlin',
'com.fasterxml.jackson.datatype:jackson-datatype-jsr310',
"no.skatteetaten.aurora.springboot:aurora-spring-boot2-starter:1.2.2",
'io.fabric8:openshift-client:4.0.4',
'com.fkorotkov:kubernetes-dsl:1.0.1',
"org.springframework.retry:spring-retry",
'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.21.2',
'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.30.0',
'org.springframework.boot:spring-boot-starter-security',
"org.springframework.boot:spring-boot-starter-hateoas"
)
Expand Down
Expand Up @@ -83,7 +83,7 @@ class ApplicationDataServiceCacheDecorator(
cache.remove(it)
}
val keys = cache.keys().toList()
logger.debug("cache keys={}", keys)
// logger.debug("cache keys={}", keys)
logger.info("number of apps={} time={}", keys.size, time.totalTimeSeconds)
}

Expand Down
Expand Up @@ -68,15 +68,31 @@ class ApplicationDataServiceOpenShift(

private fun findAllApplicationDataByEnvironments(environments: List<Environment> = findAllEnvironments()): List<ApplicationData> {

logger.info("finding all applications in environments=$environments")
logger.debug("finding all applications in environments=$environments")
return runBlocking(mtContext) {
environments
.flatMap { environment ->
logger.debug("Finding ApplicationDeployments in namespace={}", environment)
val deployments = openshiftService.applicationDeployments(environment.namespace)
logger.debug("Found {} ApplicationDeployments in namespace={}", deployments.size, environment)
deployments.map { async(mtContext) { tryCreateApplicationData(it) } }
}.mapNotNull { it.await().applicationData }
val applicationDeployments = environments.flatMap { environment ->
logger.debug("Finding ApplicationDeployments in namespace={}", environment)
openshiftService.applicationDeployments(environment.namespace)
}

val results = applicationDeployments.map {
async(mtContext) { tryCreateApplicationData(it) }
}.map {
it.await()
}

val errors = results.mapNotNull { it.error }

val data = results.mapNotNull { it.applicationData }
data.groupBy { it.applicationDeploymentId }.filter { it.value.size != 1 }.forEach {
val names = it.value.map { "${it.namespace}/${it.applicationDeploymentName}" }
logger.info("Duplicate applicationDeploymeentId for=${names}")
}



logger.info("Found deployments=${applicationDeployments.size} data=${data.size} result=${results.size} errors=${errors.size}")
data
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.yaml
Expand Up @@ -15,8 +15,8 @@ aurora:

logging:
level:
no.skatteetaten.aurora.mokey: INFO
io.fabric8.openshift.client.DefaultOpenShiftClient: INFO
no.skatteetaten.aurora:
mokey: INFO
org:
hibernate: WARN
springframework: WARN
Expand Down

0 comments on commit 04ad2c6

Please sign in to comment.