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
|
||||
|
||||
report = "#{diff.length} objects have leaked\n"
|
||||
|
||||
|
||||
require 'objspace'
|
||||
diff = diff.map do |id|
|
||||
ObjectSpace._id2ref(id) rescue nil
|
||||
end.compact!
|
||||
|
||||
report = "#{diff.length} objects have leaked\n"
|
||||
|
||||
report << "Summary:\n"
|
||||
|
||||
summary = {}
|
||||
|
@ -72,7 +71,7 @@ class Admin::DiagnosticsController < Admin::AdminController
|
|||
"#{k}: #{v}"
|
||||
}.join("\n")
|
||||
|
||||
report << "\nSample Items:\n"
|
||||
report << "\n\nSample Items:\n"
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue