use of org.apache.geode.internal.admin.Stat in project geode by apache.
the class StatisticResourceImpl method refresh.
// -------------------------------------------------------------------------
// Operations
// -------------------------------------------------------------------------
public void refresh() throws org.apache.geode.admin.AdminException {
Stat[] stats = null;
if (this.statResource != null) {
stats = this.statResource.getStats();
}
if (stats == null || stats.length < 1) {
throw new AdminException(LocalizedStrings.StatisticResourceImpl_FAILED_TO_REFRESH_STATISTICS_0_FOR_1.toLocalizedString(getType() + "-" + getName(), getOwner()));
}
if (this.statistics == null || this.statistics.length < 1) {
// define new statistics instances...
List statList = new ArrayList();
for (int i = 0; i < stats.length; i++) {
statList.add(createStatistic(stats[i]));
}
this.statistics = (Statistic[]) statList.toArray(new Statistic[0]);
} else {
// update the existing instances...
for (int i = 0; i < stats.length; i++) {
updateStatistic(stats[i]);
}
}
}
Aggregations