// Path: breakerbox-turbine/src/main/java/com/yammer/breakerbox/turbine/TurbineInstanceDiscovery.java
// public class TurbineInstanceDiscovery {
//     private static final Logger LOGGER = LoggerFactory.getLogger(TurbineInstanceDiscovery.class);
//     public static final String BREAKERBOX_INSTANCE_ID = "Breakerbox-Instance-Id";
//     public static final String DEFAULT_URL_SUFFIX = "/tenacity/metrics.stream";
// 
//     private TurbineInstanceDiscovery() {}
// 
//     public static void registerClusters(Collection<String> clusterNames) {
//         registerClusters(clusterNames, DEFAULT_URL_SUFFIX);
//     }
// 
//     public static void registerClusters(Collection<String> clusterNames,
//                                         String instanceUrlSuffix) {
//         final AbstractConfiguration configurationManager = ConfigurationManager.getConfigInstance();
//         configurationManager.setProperty(InstanceDiscovery.TURBINE_AGGREGATOR_CLUSTER_CONFIG,
//                 Joiner.on(',').join(clusterNames));
//         configurationManager.setProperty("turbine.instanceUrlSuffix", instanceUrlSuffix);
//         final ClusterMonitorFactory<?> clusterMonitorFactory = PluginsFactory.getClusterMonitorFactory();
//         if (clusterMonitorFactory != null) {
//             try {
//                 clusterMonitorFactory.initClusterMonitors();
//             } catch (Exception err) {
//                 LOGGER.error("Trouble initializing cluster monitors", err);
//             }
//         }
//     }
// }


import com.fasterxml.jackson.annotation.JsonUnwrapped;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.net.HostAndPort;
import com.netflix.turbine.discovery.Instance;
import com.yammer.breakerbox.turbine.TurbineInstanceDiscovery;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Collections;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
package com.yammer.breakerbox.turbine.config;



public class YamlInstanceConfiguration {

    @JsonUnwrapped
    @Valid
    private ImmutableMap<String, Cluster> clusters = ImmutableMap.of(
            "breakerbox", Cluster.withInstances(HostAndPort.fromParts("localhost", 8080)),
            "production", Cluster.withClusters("breakerbox"));

    @NotNull
// Path: breakerbox-turbine/src/main/java/com/yammer/breakerbox/turbine/TurbineInstanceDiscovery.java
// public class TurbineInstanceDiscovery {
//     private static final Logger LOGGER = LoggerFactory.getLogger(TurbineInstanceDiscovery.class);
//     public static final String BREAKERBOX_INSTANCE_ID = "Breakerbox-Instance-Id";
//     public static final String DEFAULT_URL_SUFFIX = "/tenacity/metrics.stream";
// 
//     private TurbineInstanceDiscovery() {}
// 
//     public static void registerClusters(Collection<String> clusterNames) {
//         registerClusters(clusterNames, DEFAULT_URL_SUFFIX);
//     }
// 
//     public static void registerClusters(Collection<String> clusterNames,
//                                         String instanceUrlSuffix) {
//         final AbstractConfiguration configurationManager = ConfigurationManager.getConfigInstance();
//         configurationManager.setProperty(InstanceDiscovery.TURBINE_AGGREGATOR_CLUSTER_CONFIG,
//                 Joiner.on(',').join(clusterNames));
//         configurationManager.setProperty("turbine.instanceUrlSuffix", instanceUrlSuffix);
//         final ClusterMonitorFactory<?> clusterMonitorFactory = PluginsFactory.getClusterMonitorFactory();
//         if (clusterMonitorFactory != null) {
//             try {
//                 clusterMonitorFactory.initClusterMonitors();
//             } catch (Exception err) {
//                 LOGGER.error("Trouble initializing cluster monitors", err);
//             }
//         }
//     }
// }


// Path: breakerbox-turbine/src/main/java/com/yammer/breakerbox/turbine/config/YamlInstanceConfiguration.java
import com.fasterxml.jackson.annotation.JsonUnwrapped;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.net.HostAndPort;
import com.netflix.turbine.discovery.Instance;
import com.yammer.breakerbox.turbine.TurbineInstanceDiscovery;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Collections;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

package com.yammer.breakerbox.turbine.config;



public class YamlInstanceConfiguration {

    @JsonUnwrapped
    @Valid
    private ImmutableMap<String, Cluster> clusters = ImmutableMap.of(
            "breakerbox", Cluster.withInstances(HostAndPort.fromParts("localhost", 8080)),
            "production", Cluster.withClusters("breakerbox"));

    @NotNull
    private String urlSuffix = TurbineInstanceDiscovery.DEFAULT_URL_SUFFIX;