Class: Fluent::Plugin::PrometheusMetrics
- Inherits:
-
Object
- Object
- Fluent::Plugin::PrometheusMetrics
- Defined in:
- lib/fluent/plugin/prometheus_metrics.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
writeonly
Sets the attribute comments.
-
#metrics ⇒ Object
writeonly
Sets the attribute metrics.
Instance Method Summary collapse
- #add_comment(comment) ⇒ Object
- #add_metric_value(value) ⇒ Object
-
#initialize ⇒ PrometheusMetrics
constructor
A new instance of PrometheusMetrics.
- #to_string ⇒ Object
Constructor Details
#initialize ⇒ PrometheusMetrics
Returns a new instance of PrometheusMetrics.
9 10 11 12 |
# File 'lib/fluent/plugin/prometheus_metrics.rb', line 9 def initialize @comments = [] @metrics = [] end |
Instance Attribute Details
#comments=(value) ⇒ Object (writeonly)
Sets the attribute comments
26 27 28 |
# File 'lib/fluent/plugin/prometheus_metrics.rb', line 26 def comments=(value) @comments = value end |
#metrics=(value) ⇒ Object (writeonly)
Sets the attribute metrics
26 27 28 |
# File 'lib/fluent/plugin/prometheus_metrics.rb', line 26 def metrics=(value) @metrics = value end |
Instance Method Details
#add_comment(comment) ⇒ Object
18 19 20 |
# File 'lib/fluent/plugin/prometheus_metrics.rb', line 18 def add_comment(comment) @comments << comment end |
#add_metric_value(value) ⇒ Object
22 23 24 |
# File 'lib/fluent/plugin/prometheus_metrics.rb', line 22 def add_metric_value(value) @metrics << value end |
#to_string ⇒ Object
14 15 16 |
# File 'lib/fluent/plugin/prometheus_metrics.rb', line 14 def to_string (@comments + @metrics).join("\n") end |