diff options
Diffstat (limited to 'sources/hv-collector-health-check')
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() } } |