mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
improve formatting
This commit is contained in:
parent
d5405eebde
commit
39e828dee4
1 changed files with 3 additions and 4 deletions
|
@ -48,14 +48,13 @@ class Admin::DiagnosticsController < Admin::AdminController
|
||||||
|
|
||||||
diff = from - to
|
diff = from - to
|
||||||
|
|
||||||
report = "#{diff.length} objects have leaked\n"
|
|
||||||
|
|
||||||
|
|
||||||
require 'objspace'
|
require 'objspace'
|
||||||
diff = diff.map do |id|
|
diff = diff.map do |id|
|
||||||
ObjectSpace._id2ref(id) rescue nil
|
ObjectSpace._id2ref(id) rescue nil
|
||||||
end.compact!
|
end.compact!
|
||||||
|
|
||||||
|
report = "#{diff.length} objects have leaked\n"
|
||||||
|
|
||||||
report << "Summary:\n"
|
report << "Summary:\n"
|
||||||
|
|
||||||
summary = {}
|
summary = {}
|
||||||
|
@ -72,7 +71,7 @@ class Admin::DiagnosticsController < Admin::AdminController
|
||||||
"#{k}: #{v}"
|
"#{k}: #{v}"
|
||||||
}.join("\n")
|
}.join("\n")
|
||||||
|
|
||||||
report << "\nSample Items:\n"
|
report << "\n\nSample Items:\n"
|
||||||
|
|
||||||
diff[0..5000].each do |v|
|
diff[0..5000].each do |v|
|
||||||
report << "#{v.class}: #{String === v ? v[0..300] : (40 + ObjectSpace.memsize_of(v)).to_s + " bytes"}\n" rescue nil
|
report << "#{v.class}: #{String === v ? v[0..300] : (40 + ObjectSpace.memsize_of(v)).to_s + " bytes"}\n" rescue nil
|
||||||
|
|
Loading…
Reference in a new issue