Class: Prometheus::Client::Container
- Inherits:
-
Object
- Object
- Prometheus::Client::Container
- Defined in:
- lib/prometheus/client/container.rb
Overview
Metric Container
Instance Attribute Summary collapse
-
#base_labels ⇒ Object
readonly
Returns the value of attribute base_labels.
-
#docstring ⇒ Object
readonly
Returns the value of attribute docstring.
-
#metric ⇒ Object
readonly
Returns the value of attribute metric.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, docstring, metric, base_labels) ⇒ Container
constructor
A new instance of Container.
- #to_json(*json) ⇒ Object
Constructor Details
#initialize(name, docstring, metric, base_labels) ⇒ Container
Returns a new instance of Container.
9 10 11 12 13 14 |
# File 'lib/prometheus/client/container.rb', line 9 def initialize(name, docstring, metric, base_labels) @name = name @docstring = docstring @metric = metric @base_labels = LabelSet.new(base_labels) end |
Instance Attribute Details
#base_labels ⇒ Object (readonly)
Returns the value of attribute base_labels.
7 8 9 |
# File 'lib/prometheus/client/container.rb', line 7 def base_labels @base_labels end |
#docstring ⇒ Object (readonly)
Returns the value of attribute docstring.
7 8 9 |
# File 'lib/prometheus/client/container.rb', line 7 def docstring @docstring end |
#metric ⇒ Object (readonly)
Returns the value of attribute metric.
7 8 9 |
# File 'lib/prometheus/client/container.rb', line 7 def metric @metric end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/prometheus/client/container.rb', line 7 def name @name end |
Instance Method Details
#to_json(*json) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/prometheus/client/container.rb', line 16 def to_json(*json) { 'baseLabels' => base_labels.merge(:name => name), 'docstring' => docstring, 'metric' => metric }.to_json(*json) end |