Skip to content

Commit

Permalink
Rename method to better reflect what it does
Browse files Browse the repository at this point in the history
As we see, it takes a very long name to describe what it does. Perhaps
we can lower the complexity in future.
  • Loading branch information
isimluk committed Oct 25, 2016
1 parent e31d499 commit bc575d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/chargeback.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ def calculate_costs(metric_rollup_records, rates, hours_in_interval)
cost = r.cost(metric_value) * hours_in_interval
end

reportable_metric_and_cost_fields(r.rate_name, r.group, metric_value, cost)
accumulate_metrics_and_costs_per_rate(r.rate_name, r.group, metric_value, cost)
end
end
end

def reportable_metric_and_cost_fields(rate_name, rate_group, metric, cost)
def accumulate_metrics_and_costs_per_rate(rate_name, rate_group, metric, cost)
cost_key = "#{rate_name}_cost" # metric cost value (e.g. Storage [Used|Allocated|Fixed] Cost)
metric_key = "#{rate_name}_metric" # metric value (e.g. Storage [Used|Allocated|Fixed])
cost_group_key = "#{rate_group}_cost" # for total of metric's costs (e.g. Storage Total Cost)
Expand All @@ -164,7 +164,7 @@ def reportable_metric_and_cost_fields(rate_name, rate_group, metric, cost)
self[k] += val
end
end
private :reportable_metric_and_cost_fields
private :accumulate_metrics_and_costs_per_rate

def self.report_cb_model(model)
model.gsub(/^Chargeback/, "")
Expand Down

0 comments on commit bc575d3

Please sign in to comment.