Skip to content

Commit

Permalink
remove proof-of-concept flag for controlling health status
Browse files Browse the repository at this point in the history
  • Loading branch information
yaauie committed Oct 7, 2024
1 parent aaede5b commit c96baaf
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@
*/
package org.logstash.health;

import com.google.common.collect.Iterables;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.EnumSet;

public class HealthObserver {

private static final Logger LOGGER = LogManager.getLogger();
Expand All @@ -36,17 +33,7 @@ public HealthObserver() {
}

public final Status getStatus() {
// INTERNAL-ONLY Proof-of-concept to show flow-through to API results
switch (System.getProperty("logstash.apiStatus", "green")) {
case "green": return Status.GREEN;
case "yellow": return Status.YELLOW;
case "red": return Status.RED;
case "random":
final EnumSet<Status> statuses = EnumSet.allOf(Status.class);
return Iterables.get(statuses, new java.util.Random().nextInt(statuses.size()));
default:
return getReport().getStatus();
}
return getReport().getStatus();
}

public MultiIndicator getIndicator() {
Expand Down

0 comments on commit c96baaf

Please sign in to comment.