mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 13:23:38 +08:00
improve formatting
This commit is contained in:
parent
d5405eebde
commit
39e828dee4
|
@ -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 New Issue
Block a user