List<MBeanAttributeInfo> attributesList = new ArrayList<MBeanAttributeInfo>();
Set<String> typeNames = new HashSet<String>();
Iterator<Entry<String, TimeSeries>> statIter = statistics.iterator();
while (statIter.hasNext()) {
Entry<String, TimeSeries> entry = statIter.next();
attributesList.add(new MBeanAttributeInfo("PerSecond_"
+ entry.getKey(), long.class.getName(),
"Current per second value of " + entry.getKey(),
true, false, false));
attributesList.add(new MBeanAttributeInfo("LastMinutePerSecond_"
+ entry.getKey(), long[].class.getName(),
"Last minute of per seconds values of "
+ entry.getKey(), true, false, false));
attributesList.add(new MBeanAttributeInfo("PerMinute"
+ entry.getKey(), long.class.getName(),
"Current per minute value of " + entry.getKey(),
true, false, false));
attributesList.add(new MBeanAttributeInfo("LastHourPerMinute_"
+ entry.getKey(), long[].class.getName(),
"Last hour of per minute values of "
+ entry.getKey(), true, false, false));
attributesList.add(new MBeanAttributeInfo("PerHour_"
+ entry.getKey(), long.class.getName(),
"Current per hour value of " + entry.getKey(), true,
false, false));
attributesList.add(new MBeanAttributeInfo("LastWeekPerHour_"
+ entry.getKey(), long[].class.getName(),
"Last week of per hour values of " + entry.getKey(),
true, false, false));
attributesList.add(new MBeanAttributeInfo("PerWeek_"
+ entry.getKey(), long.class.getName(),
"Current per week value of " + entry.getKey(), true,
false, false));
attributesList.add(new MBeanAttributeInfo("LastYearPerWeek_"
+ entry.getKey(), long[].class.getName(),
"Last year of per week values of " + entry.getKey(),
true, false, false));
typeNames.add(entry.getKey());
}
for (Type t : Type.values()) {
final String name = t.name();
if (!typeNames.contains(name)) {
attributesList.add(new MBeanAttributeInfo(name, long.class
.getName(), "Current counter value of " + name,
true, false, false));
typeNames.add(name);
}
}