ManagedBean addDynamicAttributes(ManagedBean managed)
      throws org.apache.geode.admin.AdminException {
    if (managed == null) {
      throw new IllegalArgumentException(
          "ManagedBean is null");
    }

    refresh(); // to get the stats...

    // need to create a new instance of ManagedBean to clean the "slate"...
    ManagedBean newManagedBean = new DynamicManagedBean(managed);
    for (final Statistic statistic : statistics) {
      StatisticAttributeInfo attrInfo = new StatisticAttributeInfo();

      attrInfo.setName(statistic.getName());
      attrInfo.setDisplayName(statistic.getName());
      attrInfo.setDescription(statistic.getDescription());
      attrInfo.setType("java.lang.Number");

      attrInfo.setIs(false);
      attrInfo.setReadable(true);
      attrInfo.setWriteable(false);

      attrInfo.setStat(statistic);

      newManagedBean.addAttribute(attrInfo);
    }
    return newManagedBean;
  }
Add MBean attribute definitions for each Statistic.

@param managed the mbean definition to add attributes to
@return a new instance of ManagedBean copied from <code>managed</code> but with the new
        attributes added
geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticResourceJmxImpl.java