Class: Prometheus::Client::Summary::Value

Inherits:
Hash
  • Object
show all
Defined in:
lib/prometheus/client/summary.rb

Overview

Value represents the state of a Summary at a given point.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(estimator) ⇒ Value

Returns a new instance of Value.



15
16
17
18
19
20
21
22
# File 'lib/prometheus/client/summary.rb', line 15

def initialize(estimator)
  @sum = estimator.sum
  @total = estimator.observations

  estimator.invariants.each do |invariant|
    self[invariant.quantile] = estimator.query(invariant.quantile)
  end
end

Instance Attribute Details

#sumObject

Returns the value of attribute sum.



13
14
15
# File 'lib/prometheus/client/summary.rb', line 13

def sum
  @sum
end

#totalObject

Returns the value of attribute total.



13
14
15
# File 'lib/prometheus/client/summary.rb', line 13

def total
  @total
end