Create spring-boot-health module
This commit is contained in:
@@ -19,15 +19,15 @@ package org.springframework.boot.data.redis.autoconfigure.health;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
|
||||
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
|
||||
import org.springframework.boot.actuate.health.HealthContributor;
|
||||
import org.springframework.boot.actuate.health.HealthIndicator;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.data.redis.actuate.health.RedisHealthIndicator;
|
||||
import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration;
|
||||
import org.springframework.boot.data.redis.health.RedisHealthIndicator;
|
||||
import org.springframework.boot.health.HealthContributor;
|
||||
import org.springframework.boot.health.HealthIndicator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
|
||||
|
||||
@@ -21,15 +21,15 @@ import reactor.core.publisher.Flux;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration;
|
||||
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
|
||||
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
|
||||
import org.springframework.boot.actuate.health.ReactiveHealthIndicator;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.data.redis.actuate.health.RedisReactiveHealthIndicator;
|
||||
import org.springframework.boot.data.redis.autoconfigure.RedisReactiveAutoConfiguration;
|
||||
import org.springframework.boot.data.redis.health.RedisReactiveHealthIndicator;
|
||||
import org.springframework.boot.health.ReactiveHealthContributor;
|
||||
import org.springframework.boot.health.ReactiveHealthIndicator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory;
|
||||
|
||||
|
||||
@@ -14,12 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.data.redis.actuate.health;
|
||||
package org.springframework.boot.data.redis.health;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.springframework.boot.actuate.health.Health;
|
||||
import org.springframework.boot.actuate.health.Health.Builder;
|
||||
import org.springframework.boot.health.Health;
|
||||
import org.springframework.data.redis.connection.ClusterInfo;
|
||||
|
||||
/**
|
||||
@@ -33,12 +32,12 @@ final class RedisHealth {
|
||||
private RedisHealth() {
|
||||
}
|
||||
|
||||
static Builder up(Health.Builder builder, Properties info) {
|
||||
static Health.Builder up(Health.Builder builder, Properties info) {
|
||||
builder.withDetail("version", info.getProperty("redis_version"));
|
||||
return builder.up();
|
||||
}
|
||||
|
||||
static Builder fromClusterInfo(Health.Builder builder, ClusterInfo clusterInfo) {
|
||||
static Health.Builder fromClusterInfo(Health.Builder builder, ClusterInfo clusterInfo) {
|
||||
builder.withDetail("cluster_size", clusterInfo.getClusterSize());
|
||||
builder.withDetail("slots_up", clusterInfo.getSlotsOk());
|
||||
builder.withDetail("slots_fail", clusterInfo.getSlotsFail());
|
||||
@@ -14,11 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.data.redis.actuate.health;
|
||||
package org.springframework.boot.data.redis.health;
|
||||
|
||||
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
|
||||
import org.springframework.boot.actuate.health.Health;
|
||||
import org.springframework.boot.actuate.health.HealthIndicator;
|
||||
import org.springframework.boot.health.AbstractHealthIndicator;
|
||||
import org.springframework.boot.health.Health;
|
||||
import org.springframework.boot.health.HealthIndicator;
|
||||
import org.springframework.data.redis.connection.RedisClusterConnection;
|
||||
import org.springframework.data.redis.connection.RedisConnection;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
@@ -14,16 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.data.redis.actuate.health;
|
||||
package org.springframework.boot.data.redis.health;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.scheduler.Schedulers;
|
||||
|
||||
import org.springframework.boot.actuate.health.AbstractReactiveHealthIndicator;
|
||||
import org.springframework.boot.actuate.health.Health;
|
||||
import org.springframework.boot.actuate.health.ReactiveHealthIndicator;
|
||||
import org.springframework.boot.health.AbstractReactiveHealthIndicator;
|
||||
import org.springframework.boot.health.Health;
|
||||
import org.springframework.boot.health.ReactiveHealthIndicator;
|
||||
import org.springframework.data.redis.connection.ClusterInfo;
|
||||
import org.springframework.data.redis.connection.ReactiveRedisClusterConnection;
|
||||
import org.springframework.data.redis.connection.ReactiveRedisConnection;
|
||||
@@ -17,4 +17,4 @@
|
||||
/**
|
||||
* Redis health integration using Spring Data Redis.
|
||||
*/
|
||||
package org.springframework.boot.data.redis.actuate.health;
|
||||
package org.springframework.boot.data.redis.health;
|
||||
@@ -20,9 +20,9 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.data.redis.actuate.health.RedisHealthIndicator;
|
||||
import org.springframework.boot.data.redis.actuate.health.RedisReactiveHealthIndicator;
|
||||
import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration;
|
||||
import org.springframework.boot.data.redis.health.RedisHealthIndicator;
|
||||
import org.springframework.boot.data.redis.health.RedisReactiveHealthIndicator;
|
||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||
import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.data.redis.actuate.health.RedisHealthIndicator;
|
||||
import org.springframework.boot.data.redis.actuate.health.RedisReactiveHealthIndicator;
|
||||
import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration;
|
||||
import org.springframework.boot.data.redis.health.RedisHealthIndicator;
|
||||
import org.springframework.boot.data.redis.health.RedisReactiveHealthIndicator;
|
||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.data.redis.actuate.health;
|
||||
package org.springframework.boot.data.redis.health;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -22,8 +22,8 @@ import java.util.Properties;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.actuate.health.Health;
|
||||
import org.springframework.boot.actuate.health.Status;
|
||||
import org.springframework.boot.health.Health;
|
||||
import org.springframework.boot.health.Status;
|
||||
import org.springframework.data.redis.RedisConnectionFailureException;
|
||||
import org.springframework.data.redis.connection.ClusterInfo;
|
||||
import org.springframework.data.redis.connection.RedisClusterConnection;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.data.redis.actuate.health;
|
||||
package org.springframework.boot.data.redis.health;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.Properties;
|
||||
@@ -24,8 +24,8 @@ import org.junit.jupiter.api.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.boot.actuate.health.Health;
|
||||
import org.springframework.boot.actuate.health.Status;
|
||||
import org.springframework.boot.health.Health;
|
||||
import org.springframework.boot.health.Status;
|
||||
import org.springframework.data.redis.RedisConnectionFailureException;
|
||||
import org.springframework.data.redis.connection.ClusterInfo;
|
||||
import org.springframework.data.redis.connection.ReactiveRedisClusterConnection;
|
||||
Reference in New Issue
Block a user