public void accumulate(BandwidthUsage usage) {
// get the measurement name of usage entry
String key = usage.getMeasurement();
// get the existing value of measurement
BandwidthUsage existingUsage = usageMap.get(key);
// if this measurement is metered earlier add the new value to the existing value
if (existingUsage != null) {
existingUsage.setValue(existingUsage.getValue() + usage.getValue());
} else {
// if this measurement is not metered previously we need to add it to the usageMap
usageMap.put(key, usage);
}
}