mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 10:50:26 -06:00
Revert "Add rake task to gather GC.stat
for Sidekiq."
This reverts commit 15e2f55655
.
This commit is contained in:
parent
b74c61777a
commit
5fab2042f5
@ -1,21 +0,0 @@
|
||||
desc "Returns `GC.stat` for each Sidekiq process in JSON"
|
||||
task "sidekiq:gc_stat" do
|
||||
pids = `ps -eo pid,args | grep ' [s]idekiq ' | awk '{print $1}'`.split("\n").map(&:to_i)
|
||||
results = []
|
||||
hostname = `hostname`.chomp
|
||||
|
||||
pids.each do |pid|
|
||||
tmp_path = Tempfile.new.path
|
||||
|
||||
system(
|
||||
"bundle exec rbtrace -p #{pid} -e \"o = GC.stat; f = File.open('#{tmp_path}', 'w'); f.write(o.to_json); f.close\"",
|
||||
out: "/dev/null", err: "/dev/null"
|
||||
)
|
||||
|
||||
result = JSON.parse(File.read(tmp_path))
|
||||
result["hostname"] = hostname
|
||||
results << result
|
||||
end
|
||||
|
||||
puts results.to_json
|
||||
end
|
Loading…
Reference in New Issue
Block a user