@Test public void testAddMetricObserver() { LookoutRegistry reg = new LookoutRegistry(new LookoutConfig()); LogObserver logObserver = new LogObserver(); MetricObserverUtil.addMetricObservers(reg, logObserver); Assert.assertTrue(reg.getMetricObservers().contains(logObserver)); }
public static boolean addMetricObservers(Registry registry, MetricObserver... metricObservers) { boolean flag = false; if (registry instanceof LookoutRegistry) { for (MetricObserver metricObserver : metricObservers) { ((LookoutRegistry) registry).addMetricObserver(metricObserver); } flag = true; } if (registry instanceof CompositeRegistry) { for (Registry reg : ((CompositeRegistry) registry).getRegistries()) { if (reg instanceof LookoutRegistry) { for (MetricObserver metricObserver : metricObservers) { ((LookoutRegistry) reg).addMetricObserver(metricObserver); } flag = true; } } } return flag; }
MetricObserverUtil { public static boolean addMetricObservers(Registry registry, MetricObserver... metricObservers) { boolean flag = false; if (registry instanceof LookoutRegistry) { for (MetricObserver metricObserver : metricObservers) { ((LookoutRegistry) registry).addMetricObserver(metricObserver); } flag = true; } if (registry instanceof CompositeRegistry) { for (Registry reg : ((CompositeRegistry) registry).getRegistries()) { if (reg instanceof LookoutRegistry) { for (MetricObserver metricObserver : metricObservers) { ((LookoutRegistry) reg).addMetricObserver(metricObserver); } flag = true; } } } return flag; } }
MetricObserverUtil { public static boolean addMetricObservers(Registry registry, MetricObserver... metricObservers) { boolean flag = false; if (registry instanceof LookoutRegistry) { for (MetricObserver metricObserver : metricObservers) { ((LookoutRegistry) registry).addMetricObserver(metricObserver); } flag = true; } if (registry instanceof CompositeRegistry) { for (Registry reg : ((CompositeRegistry) registry).getRegistries()) { if (reg instanceof LookoutRegistry) { for (MetricObserver metricObserver : metricObservers) { ((LookoutRegistry) reg).addMetricObserver(metricObserver); } flag = true; } } } return flag; } private  MetricObserverUtil(); }
MetricObserverUtil { public static boolean addMetricObservers(Registry registry, MetricObserver... metricObservers) { boolean flag = false; if (registry instanceof LookoutRegistry) { for (MetricObserver metricObserver : metricObservers) { ((LookoutRegistry) registry).addMetricObserver(metricObserver); } flag = true; } if (registry instanceof CompositeRegistry) { for (Registry reg : ((CompositeRegistry) registry).getRegistries()) { if (reg instanceof LookoutRegistry) { for (MetricObserver metricObserver : metricObservers) { ((LookoutRegistry) reg).addMetricObserver(metricObserver); } flag = true; } } } return flag; } private  MetricObserverUtil(); static boolean addMetricObservers(Registry registry, MetricObserver... metricObservers); }
MetricObserverUtil { public static boolean addMetricObservers(Registry registry, MetricObserver... metricObservers) { boolean flag = false; if (registry instanceof LookoutRegistry) { for (MetricObserver metricObserver : metricObservers) { ((LookoutRegistry) registry).addMetricObserver(metricObserver); } flag = true; } if (registry instanceof CompositeRegistry) { for (Registry reg : ((CompositeRegistry) registry).getRegistries()) { if (reg instanceof LookoutRegistry) { for (MetricObserver metricObserver : metricObservers) { ((LookoutRegistry) reg).addMetricObserver(metricObserver); } flag = true; } } } return flag; } private  MetricObserverUtil(); static boolean addMetricObservers(Registry registry, MetricObserver... metricObservers);  }