com.bagri.server.hazelcast.stats.UsageStatsAggregator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bagri-server-hazelcast Show documentation
Show all versions of bagri-server-hazelcast Show documentation
Bagri DB Cache: Hazelcast implementation
The newest version!
package com.bagri.server.hazelcast.stats;
import com.bagri.support.stats.StatsAggregator;
public class UsageStatsAggregator implements StatsAggregator {
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public Object[] aggregateStats(Object[] source, Object[] target) {
target[0] = (Integer) source[0] + (Integer) target[0]; // accessed
target[1] = ((Comparable) source[1]).compareTo((Comparable) target[1]) < 0 ? source[1] : target[1]; // first
target[2] = (Integer) source[2] + (Integer) target[2]; // hits
target[3] = ((Comparable) source[3]).compareTo((Comparable) target[3]) > 0 ? source[3] : target[3]; // last
target[4] = (Integer) source[4] + (Integer) target[4]; // miss
target[5] = source[5]; // resource
return target;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy