summaryrefslogtreecommitdiffstats
path: root/sources/hv-collector-health-check
diff options
context:
space:
mode:
authorFilip Krzywka <filip.krzywka@nokia.com>2019-01-08 07:53:25 +0100
committerFilip Krzywka <filip.krzywka@nokia.com>2019-01-08 12:11:26 +0100
commit5180f3f32a2cdd35206f728e0fd7dd6ad62b567a (patch)
tree3929c3327086a1d9381994e6572b43200519ca20 /sources/hv-collector-health-check
parent8b4e282df3863042c69dae60460ec2397e12562e (diff)
Merge Healthcheck descriptions
- start new API server for healthchecks in xNF simulator on port 6063 - changed DCAE App default port to 6064 - switched to InetSocketAddresses usage in components configurations Change-Id: I398f9ea6e887f78d88286ed717d310d3297b1571 Issue-ID: DCAEGEN2-1063 Signed-off-by: Filip Krzywka <filip.krzywka@nokia.com>
Diffstat (limited to 'sources/hv-collector-health-check')
-rw-r--r--sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/api/HealthDescription.kt9
-rw-r--r--sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt2
-rw-r--r--sources/hv-collector-health-check/src/test/kotlin/org/onap/dcae/collectors/veshv/healthcheck/impl/HealthStateProviderImplTest.kt12
3 files changed, 13 insertions, 10 deletions
diff --git a/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/api/HealthDescription.kt b/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/api/HealthDescription.kt
index 8c69406c..4758fb6b 100644
--- a/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/api/HealthDescription.kt
+++ b/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/api/HealthDescription.kt
@@ -25,8 +25,11 @@ package org.onap.dcae.collectors.veshv.healthcheck.api
* @since August 2018
*/
enum class HealthDescription(val message: String, val status: HealthStatus) {
+ STARTING("Component is starting", HealthStatus.OUT_OF_SERVICE),
HEALTHY("Healthy", HealthStatus.UP),
- STARTING("Collector is starting", HealthStatus.OUT_OF_SERVICE),
- RETRYING_FOR_CONSUL_CONFIGURATION("Consul configuration not available. Retrying.", HealthStatus.OUT_OF_SERVICE),
- CONSUL_CONFIGURATION_NOT_FOUND("Consul configuration not found", HealthStatus.DOWN)
+ BUSY("Processing at least one request", HealthStatus.UP),
+ IDLE("No simulation is in progress at the moment", HealthStatus.UP),
+ /* Configuration related */
+ RETRYING_FOR_DYNAMIC_CONFIGURATION("Dynamic configuration not available. Retrying.", HealthStatus.OUT_OF_SERVICE),
+ DYNAMIC_CONFIGURATION_NOT_FOUND("Dynamic configuration not found", HealthStatus.DOWN)
}
diff --git a/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt b/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt
index aead71bb..7aade34b 100644
--- a/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt
+++ b/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt
@@ -59,7 +59,7 @@ class HealthCheckApiServer(private val healthState: HealthState,
private fun readinessHandler(_req: HttpServerRequest, resp: HttpServerResponse) =
healthDescription.get().run {
- logger.debug { "HV-VES status: $status, $message" }
+ logger.debug { "Component status: $status, $message" }
resp.status(status.httpResponseStatus.number).sendString(Flux.just(status.toString(), "\n", message))
}
diff --git a/sources/hv-collector-health-check/src/test/kotlin/org/onap/dcae/collectors/veshv/healthcheck/impl/HealthStateProviderImplTest.kt b/sources/hv-collector-health-check/src/test/kotlin/org/onap/dcae/collectors/veshv/healthcheck/impl/HealthStateProviderImplTest.kt
index e3fced2d..9a0fe2f3 100644
--- a/sources/hv-collector-health-check/src/test/kotlin/org/onap/dcae/collectors/veshv/healthcheck/impl/HealthStateProviderImplTest.kt
+++ b/sources/hv-collector-health-check/src/test/kotlin/org/onap/dcae/collectors/veshv/healthcheck/impl/HealthStateProviderImplTest.kt
@@ -35,17 +35,17 @@ object HealthStateProviderImplTest : Spek({
val healthStateProviderImpl = HealthStateImpl()
on("health state update") {
healthStateProviderImpl.changeState(HealthDescription.HEALTHY)
- healthStateProviderImpl.changeState(HealthDescription.RETRYING_FOR_CONSUL_CONFIGURATION)
- healthStateProviderImpl.changeState(HealthDescription.RETRYING_FOR_CONSUL_CONFIGURATION)
- healthStateProviderImpl.changeState(HealthDescription.CONSUL_CONFIGURATION_NOT_FOUND)
+ healthStateProviderImpl.changeState(HealthDescription.RETRYING_FOR_DYNAMIC_CONFIGURATION)
+ healthStateProviderImpl.changeState(HealthDescription.RETRYING_FOR_DYNAMIC_CONFIGURATION)
+ healthStateProviderImpl.changeState(HealthDescription.DYNAMIC_CONFIGURATION_NOT_FOUND)
it("should push new health state to the subscriber") {
StepVerifier
.create(healthStateProviderImpl().take(4))
.expectNext(HealthDescription.HEALTHY)
- .expectNext(HealthDescription.RETRYING_FOR_CONSUL_CONFIGURATION)
- .expectNext(HealthDescription.RETRYING_FOR_CONSUL_CONFIGURATION)
- .expectNext(HealthDescription.CONSUL_CONFIGURATION_NOT_FOUND)
+ .expectNext(HealthDescription.RETRYING_FOR_DYNAMIC_CONFIGURATION)
+ .expectNext(HealthDescription.RETRYING_FOR_DYNAMIC_CONFIGURATION)
+ .expectNext(HealthDescription.DYNAMIC_CONFIGURATION_NOT_FOUND)
.verifyComplete()
}
}