From 74313e23699d681f5942f4d8e6bc846c30099593 Mon Sep 17 00:00:00 2001 From: Wedge Date: Sun, 12 Jun 2016 15:14:10 +0300 Subject: [PATCH] Comment out --- config/initializers/1_sidekiq.rb | 80 ++++++++++++++++---------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/config/initializers/1_sidekiq.rb b/config/initializers/1_sidekiq.rb index 550ce8f79..226c6b251 100644 --- a/config/initializers/1_sidekiq.rb +++ b/config/initializers/1_sidekiq.rb @@ -15,49 +15,49 @@ if ENV["PROFILE"] ObjectSpace.trace_object_allocations_start Sidekiq.logger.info "allocations tracing enabled" - module Sidekiq - module Middleware - module Server - class Profiler - # Number of jobs to process before reporting - JOBS = 100 + # module Sidekiq + # module Middleware + # module Server + # class Profiler + # # Number of jobs to process before reporting + # JOBS = 100 - class << self - mattr_accessor :counter - self.counter = 0 + # class << self + # mattr_accessor :counter + # self.counter = 0 - def synchronize(&block) - @lock ||= Mutex.new - @lock.synchronize(&block) - end - end + # def synchronize(&block) + # @lock ||= Mutex.new + # @lock.synchronize(&block) + # end + # end - def call(worker_instance, item, queue) - begin - yield - ensure - self.class.synchronize do - self.class.counter += 1 + # def call(worker_instance, item, queue) + # begin + # yield + # ensure + # self.class.synchronize do + # self.class.counter += 1 - if self.class.counter % JOBS == 0 - Sidekiq.logger.info "reporting allocations after #{self.class.counter} jobs" - GC.start - out = File.open("/tmp/heap.json", "w") - ObjectSpace.dump_all(output: out) - out.close - Sidekiq.logger.info "heap saved to heap.json" - end - end - end - end - end - end - end - end + # if self.class.counter % JOBS == 0 + # Sidekiq.logger.info "reporting allocations after #{self.class.counter} jobs" + # GC.start + # out = File.open("/tmp/heap.json", "w") + # ObjectSpace.dump_all(output: out) + # out.close + # Sidekiq.logger.info "heap saved to heap.json" + # end + # end + # end + # end + # end + # end + # end + # end - Sidekiq.configure_server do |config| - config.server_middleware do |chain| - chain.add Sidekiq::Middleware::Server::Profiler - end - end + # Sidekiq.configure_server do |config| + # config.server_middleware do |chain| + # chain.add Sidekiq::Middleware::Server::Profiler + # end + # end end \ No newline at end of file