use of io.vertigo.commons.analytics.health.HealthMeasureBuilder in project vertigo by KleeGroup.
the class CachePlugin method checkIo.
/**
* @return HealthMeasure of this plugin
*/
@HealthChecked(name = "io", feature = "cache")
default HealthMeasure checkIo() {
final HealthMeasureBuilder healthMeasureBuilder = HealthMeasure.builder();
try {
put("CACHE_HEALTH_VERTIGO", "healthcheckkey", "healthcheckvalue");
get("CACHE_HEALTH_VERTIGO", "healthcheckkey");
remove("CACHE_HEALTH_VERTIGO", "healthcheckkey");
healthMeasureBuilder.withGreenStatus();
} catch (final Exception e) {
healthMeasureBuilder.withRedStatus(e.getMessage(), e);
}
return healthMeasureBuilder.build();
}
use of io.vertigo.commons.analytics.health.HealthMeasureBuilder in project vertigo by KleeGroup.
the class RedisHealthChecker method checkRedisPing.
@HealthChecked(name = "ping", feature = "redisChecker")
public HealthMeasure checkRedisPing() {
final HealthMeasureBuilder healthMeasureBuilder = HealthMeasure.builder();
try (Jedis jedis = redisConnector.getResource()) {
final String result = jedis.ping();
healthMeasureBuilder.withGreenStatus(result);
} catch (final Exception e) {
healthMeasureBuilder.withRedStatus(e.getMessage(), e);
}
return healthMeasureBuilder.build();
}
Aggregations