Sha256: 65dfe1b78cea1a34633dd151c57ea0d2df8aeddc5bce713c89a78a89cea714db
Contents?: true
Size: 881 Bytes
Versions: 32
Compression:
Stored size: 881 Bytes
Contents
module Appsignal class Minutely class << self # List of probes. Probes can be lamdba's or objects that # respond to call. def probes @@probes ||= [] end 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 Exception => ex Appsignal.logger.error("Error in minutely thread: #{ex}") end end end def wait_time 60 - Time.now.sec end def add_gc_probe probes << GCProbe.new end end class GCProbe def call GC.stat.each do |key, value| Appsignal.set_process_gauge("gc.#{key}", value) end end end end end
Version data entries
32 entries across 32 versions & 1 rubygems