Class: Appsignal::Minutely Private
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.
Defined Under Namespace
Classes: GCProbe
Class Method Summary collapse
- .add_gc_probe ⇒ Object private
-
.probes ⇒ Object
private
List of probes.
- .start ⇒ Object private
- .wait_time ⇒ Object private
Class Method Details
.add_gc_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.
29 30 31 |
# File 'lib/appsignal/minutely.rb', line 29 def add_gc_probe probes << GCProbe.new end |
.probes ⇒ 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.
List of probes. Probes can be lamdba's or objects that respond to call.
7 8 9 |
# File 'lib/appsignal/minutely.rb', line 7 def probes @@probes ||= [] end |
.start ⇒ 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.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/appsignal/minutely.rb', line 11 def start Thread.new do begin loop do Appsignal.logger.debug("Gathering minutely metrics with #{probes.count} probe(s)") probes.each(&:call) sleep(wait_time) end rescue => ex Appsignal.logger.error("Error in minutely thread: #{ex}") end end end |
.wait_time ⇒ 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.
25 26 27 |
# File 'lib/appsignal/minutely.rb', line 25 def wait_time 60 - Time.now.sec end |