@Override
  public Map<String, Double> calculateRequestQuotaCharge(RestRequest restRequest, long size) {
    Map<String, Double> costMap = new HashMap<>();
    double capacityUnitCost =
        Math.max(Math.ceil(size / (double) quotaConfig.quotaAccountingUnit), DEFAULT_MIN_QUOTA_CHARGE);
    costMap.put(QuotaUtils.getCUQuotaName(restRequest).name(), capacityUnitCost);
    costMap.put(QuotaName.STORAGE_IN_GB.name(), QuotaUtils.calculateStorageCost(restRequest, size));
    return costMap;
  }
{@link RequestQuotaCostPolicy} implementation that calculates request cost in terms of metrics tracked by user quota - capacity unit and storage.
Capacity unit cost is the as the number of config defined units in each chunk. Storage cost is defined as number of GB of storage used.
ambry-quota/src/main/java/com/github/ambry/quota/SimpleRequestQuotaCostPolicy.java