Class: RubyScriptExporter::Runner
- Inherits:
-
Object
- Object
- RubyScriptExporter::Runner
- Includes:
- Observers::Http
- Defined in:
- lib/ruby_script_exporter/runner.rb
Instance Attribute Summary collapse
-
#measurements ⇒ Object
readonly
Returns the value of attribute measurements.
Instance Method Summary collapse
-
#initialize(probe) ⇒ Runner
constructor
A new instance of Runner.
- #observe(measurement, value, **labels) ⇒ Object
Methods included from Observers::Http
Constructor Details
#initialize(probe) ⇒ Runner
Returns a new instance of Runner.
8 9 10 11 |
# File 'lib/ruby_script_exporter/runner.rb', line 8 def initialize(probe) @probe = probe @measurements = [] end |
Instance Attribute Details
#measurements ⇒ Object (readonly)
Returns the value of attribute measurements.
6 7 8 |
# File 'lib/ruby_script_exporter/runner.rb', line 6 def measurements @measurements end |
Instance Method Details
#observe(measurement, value, **labels) ⇒ Object
13 14 15 16 |
# File 'lib/ruby_script_exporter/runner.rb', line 13 def observe(measurement, value, **labels) = Time.now.to_i * 1000 @measurements << Measurement.new(measurement, value, timestamp:, probe: @probe, **labels) end |