Sha256: d55e083750851ee2357b47167f301be6f0c3cee1421a3d88b5f373cc0ae18cb1
Contents?: true
Size: 909 Bytes
Versions: 20
Compression:
Stored size: 909 Bytes
Contents
if defined?(Unicorn::WorkerKiller) Unicorn::WorkerKiller.module_eval do self.singleton_class.send(:alias_method, :kill_self_old, :kill_self) def self.kill_self(logger, start_time) self.kill_self_old(logger, start_time) if defined?(Prometheus) Prometheus::UNICORN_KILLS.set(1) else ZuoraConnect::AppInstance.write_to_telegraf(direction: 'Unicorn-Killer', tags: {app_instance: 0}, values: {kill: 1}) end end end end if defined?(Unicorn::HttpServer) && defined?(Prometheus) module HttpServerExtensions def kill_worker(signal, wpid) Prometheus::UNICORN_KILLS.increment super end end module WorkerExtensions def soft_kill(sig) Prometheus::UNICORN_KILLS.increment super end end class Unicorn::HttpServer prepend HttpServerExtensions end class Unicorn::Worker prepend WorkerExtensions end end
Version data entries
20 entries across 20 versions & 1 rubygems