@Test public void oneMBeanOneMetricUnsupportedApp() { AppType appType = null; Throwable ex = catchThrowable(() -> metricsEnquirer.getMBeanMetrics(appType)); assertThat(ex).isEqualToComparingFieldByField(new MonitoringNotSupportedException(appType)); }
public List<MBeanMetric> getMBeanMetrics(AppType appType) { List<MBeanMetric> mBeanMetrics = new ArrayList<>(); Set<ObjectName> mBeanNames; try { mBeanNames = getTesseraResourceMBeanNames(appType); for(ObjectName mBeanName : mBeanNames) { List<MBeanMetric> temp; try { temp = getMetricsForMBean(mBeanName); } catch (AttributeNotFoundException | MBeanException | InstanceNotFoundException | ReflectionException | IntrospectionException e) { throw new RuntimeException(e); } mBeanMetrics.addAll(temp); } } catch (MalformedObjectNameException e) { throw new RuntimeException(e); } return Collections.unmodifiableList(mBeanMetrics); }
MetricsEnquirer { public List<MBeanMetric> getMBeanMetrics(AppType appType) { List<MBeanMetric> mBeanMetrics = new ArrayList<>(); Set<ObjectName> mBeanNames; try { mBeanNames = getTesseraResourceMBeanNames(appType); for(ObjectName mBeanName : mBeanNames) { List<MBeanMetric> temp; try { temp = getMetricsForMBean(mBeanName); } catch (AttributeNotFoundException | MBeanException | InstanceNotFoundException | ReflectionException | IntrospectionException e) { throw new RuntimeException(e); } mBeanMetrics.addAll(temp); } } catch (MalformedObjectNameException e) { throw new RuntimeException(e); } return Collections.unmodifiableList(mBeanMetrics); } }
MetricsEnquirer { public List<MBeanMetric> getMBeanMetrics(AppType appType) { List<MBeanMetric> mBeanMetrics = new ArrayList<>(); Set<ObjectName> mBeanNames; try { mBeanNames = getTesseraResourceMBeanNames(appType); for(ObjectName mBeanName : mBeanNames) { List<MBeanMetric> temp; try { temp = getMetricsForMBean(mBeanName); } catch (AttributeNotFoundException | MBeanException | InstanceNotFoundException | ReflectionException | IntrospectionException e) { throw new RuntimeException(e); } mBeanMetrics.addAll(temp); } } catch (MalformedObjectNameException e) { throw new RuntimeException(e); } return Collections.unmodifiableList(mBeanMetrics); } MetricsEnquirer(MBeanServer mBeanServer); }
MetricsEnquirer { public List<MBeanMetric> getMBeanMetrics(AppType appType) { List<MBeanMetric> mBeanMetrics = new ArrayList<>(); Set<ObjectName> mBeanNames; try { mBeanNames = getTesseraResourceMBeanNames(appType); for(ObjectName mBeanName : mBeanNames) { List<MBeanMetric> temp; try { temp = getMetricsForMBean(mBeanName); } catch (AttributeNotFoundException | MBeanException | InstanceNotFoundException | ReflectionException | IntrospectionException e) { throw new RuntimeException(e); } mBeanMetrics.addAll(temp); } } catch (MalformedObjectNameException e) { throw new RuntimeException(e); } return Collections.unmodifiableList(mBeanMetrics); } MetricsEnquirer(MBeanServer mBeanServer); List<MBeanMetric> getMBeanMetrics(AppType appType); }
MetricsEnquirer { public List<MBeanMetric> getMBeanMetrics(AppType appType) { List<MBeanMetric> mBeanMetrics = new ArrayList<>(); Set<ObjectName> mBeanNames; try { mBeanNames = getTesseraResourceMBeanNames(appType); for(ObjectName mBeanName : mBeanNames) { List<MBeanMetric> temp; try { temp = getMetricsForMBean(mBeanName); } catch (AttributeNotFoundException | MBeanException | InstanceNotFoundException | ReflectionException | IntrospectionException e) { throw new RuntimeException(e); } mBeanMetrics.addAll(temp); } } catch (MalformedObjectNameException e) { throw new RuntimeException(e); } return Collections.unmodifiableList(mBeanMetrics); } MetricsEnquirer(MBeanServer mBeanServer); List<MBeanMetric> getMBeanMetrics(AppType appType);  }