Class: Appsignal::Probes::ProbeCollection Private
- Defined in:
- lib/appsignal/probes.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#[](key) ⇒ Object
private
Fetch a probe using its name.
-
#clear ⇒ void
private
Clears all probes from the list.
-
#count ⇒ Integer
private
Number of probes that are registered.
- #each(&block) ⇒ Object private
-
#initialize ⇒ ProbeCollection
constructor
private
A new instance of ProbeCollection.
- #internal_register(name, probe) ⇒ Object private
- #unregister(name) ⇒ Object private
Constructor Details
#initialize ⇒ ProbeCollection
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ProbeCollection.
10 11 12 |
# File 'lib/appsignal/probes.rb', line 10 def initialize @probes = {} end |
Instance Method Details
#[](key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Fetch a probe using its name.
28 29 30 |
# File 'lib/appsignal/probes.rb', line 28 def [](key) probes[key] end |
#clear ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Clears all probes from the list.
21 22 23 |
# File 'lib/appsignal/probes.rb', line 21 def clear probes.clear end |
#count ⇒ Integer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns Number of probes that are registered.
15 16 17 |
# File 'lib/appsignal/probes.rb', line 15 def count probes.count end |
#each(&block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 |
# File 'lib/appsignal/probes.rb', line 47 def each(&block) probes.each(&block) end |
#internal_register(name, probe) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 36 37 38 39 |
# File 'lib/appsignal/probes.rb', line 33 def internal_register(name, probe) if probes.key?(name) logger.debug "A probe with the name `#{name}` is already " \ "registered. Overwriting the entry with the new probe." end probes[name] = probe end |
#unregister(name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/appsignal/probes.rb', line 42 def unregister(name) probes.delete(name) end |