Class: RubyScriptExporter::Service::Builder
- Inherits:
-
Object
- Object
- RubyScriptExporter::Service::Builder
- Defined in:
- lib/ruby_script_exporter/service.rb
Instance Attribute Summary collapse
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
-
#initialize(name) ⇒ Builder
constructor
A new instance of Builder.
- #label(key, value) ⇒ Object
- #probe(name, &block) ⇒ Object
Constructor Details
#initialize(name) ⇒ Builder
Returns a new instance of Builder.
27 28 29 |
# File 'lib/ruby_script_exporter/service.rb', line 27 def initialize(name) @service = Service.new(name) end |
Instance Attribute Details
#service ⇒ Object (readonly)
Returns the value of attribute service.
25 26 27 |
# File 'lib/ruby_script_exporter/service.rb', line 25 def service @service end |
Instance Method Details
#label(key, value) ⇒ Object
31 32 33 |
# File 'lib/ruby_script_exporter/service.rb', line 31 def label(key, value) @service.labels[key] = value end |
#probe(name, &block) ⇒ Object
35 36 37 38 39 |
# File 'lib/ruby_script_exporter/service.rb', line 35 def probe(name, &block) probe_builder = Probe::Builder.new(name, @service) probe_builder.instance_eval(&block) @service.probes << probe_builder.probe end |