All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.nemerosa.ontrack.extension.influxdb.InfluxDBExtensionHealthIndicator.kt Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.extension.influxdb

import org.springframework.boot.actuate.health.Health
import org.springframework.boot.actuate.health.HealthIndicator

class InfluxDBExtensionHealthIndicator(
    private val influxDBConnection: InfluxDBConnection
) : HealthIndicator {

    override fun health(): Health {
        val ok: Boolean = try {
            influxDBConnection.isValid
        } catch (ex: Exception) {
            false
        }
        return if (ok) {
            Health.up().build()
        } else {
            Health.down().build()
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy