Skip to content

Commit

Permalink
Simplify summary value creation
Browse files Browse the repository at this point in the history
  • Loading branch information
grobie committed May 22, 2014
1 parent 166361d commit 68a09df
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/prometheus/client/summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ class Value < Hash
def initialize(estimator)
@sum, @total = estimator.sum, estimator.observations

values = estimator.invariants.each_with_object({}) do |i, memo|
memo[i.quantile] = estimator.query(i.quantile)
estimator.invariants.each do |invariant|
self[invariant.quantile] = estimator.query(invariant.quantile)
end

replace(values)
end
end

Expand Down

0 comments on commit 68a09df

Please sign in to comment.