| as yet unclassified |
| buildTable
|
^ WATableReport new
rowPeriod: 1;
rowColors: #('lightgrey' 'white');
rows: sizes keys asSortedCollection;
columns:
(Array with: (WAReportColumn selector: #yourself title: 'Class')
with: ( WAReportColumn new
title: 'Instances';
valueBlock: [:ea | instances at: ea])
with:
(WAReportColumn new
title: 'Total Size';
valueBlock: [:ea | sizes at: ea]))
|
| children
|
^ Array with: table
|
| renderContentOn: html
|
html bold: self totalInstances asString, ' instances in ', self totalSizeString.
html render: table.
|
| root: anObject
|
|segment results|
root _ anObject.
segment _ ImageSegment new copyFromRoots: (Array with: root) sizeHint: 100000.
results _ segment doSpaceAnalysis.
instances _ results first.
sizes _ results second.
table _ self buildTable.
|
| totalInstances
|
^ instances detectSum: [:ea | ea]
|
| totalSize
|
^ sizes detectSum: [:ea | ea]
|
| totalSizeString
|
|size unit|
size _ self totalSize.
unit _ 'bytes'.
size > 1024 ifTrue:
[size _ size / 1024.
unit _ 'kB'.
size > 1024 ifTrue:
[size _ size / 1024.
unit _ 'MB']].
^ (size printShowingDecimalPlaces: 1), ' ', unit
|