-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ab7cb9
commit 81cfa81
Showing
17 changed files
with
390 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
Class { | ||
#name : 'IllEphemeron', | ||
#superclass : 'Association', | ||
#type : 'ephemeron', | ||
#instVars : [ | ||
'finalizationTime', | ||
'sizeInBytes', | ||
'initializationTime', | ||
'allocatedObjectClass' | ||
], | ||
#category : 'IllimaniFinalizationProfiler-Ephemerons', | ||
#package : 'IllimaniFinalizationProfiler', | ||
#tag : 'Ephemerons' | ||
} | ||
|
||
{ #category : 'accessing' } | ||
IllEphemeron >> allocatedObjectClass [ | ||
|
||
^ allocatedObjectClass | ||
] | ||
|
||
{ #category : 'accessing' } | ||
IllEphemeron >> allocatedObjectClass: anObject [ | ||
|
||
allocatedObjectClass := anObject | ||
] | ||
|
||
{ #category : 'accessing' } | ||
IllEphemeron >> finalizationTime [ | ||
|
||
^ finalizationTime | ||
] | ||
|
||
{ #category : 'accessing' } | ||
IllEphemeron >> finalizationTime: anObject [ | ||
|
||
finalizationTime := anObject | ||
] | ||
|
||
{ #category : 'accessing' } | ||
IllEphemeron >> initializationTime [ | ||
|
||
^ initializationTime | ||
] | ||
|
||
{ #category : 'accessing' } | ||
IllEphemeron >> initializationTime: anObject [ | ||
|
||
initializationTime := anObject | ||
] | ||
|
||
{ #category : 'inspector' } | ||
IllEphemeron >> inspectorExtension: aBuilder [ | ||
|
||
<inspectorPresentationOrder: 0 title: 'Overview'> | ||
| tablePresenter elements items | | ||
elements := { | ||
('Allocated Object Class' -> allocatedObjectClass ). | ||
('Memory Size' -> sizeInBytes humanReadableByteSizeString). | ||
('Initialization time' -> initializationTime). | ||
('Finalization time' -> finalizationTime). | ||
('Object''s lifetime' -> self lifetimeAsDuration humanReadablePrintString) }. | ||
items := elements collect: [ :e | StInspectorAssociationNode hostObject: e ]. | ||
tablePresenter := aBuilder newTable. | ||
tablePresenter | ||
addColumn: (SpStringTableColumn title: 'Name' evaluated: #key); | ||
addColumn: (SpStringTableColumn title: 'Value' evaluated: #value); | ||
items: items; | ||
beResizable. | ||
^ tablePresenter | ||
] | ||
|
||
{ #category : 'accessing' } | ||
IllEphemeron >> lifetimeAsDuration [ | ||
|
||
^ Duration microSeconds: finalizationTime - initializationTime | ||
] | ||
|
||
{ #category : 'finalization' } | ||
IllEphemeron >> mourn [ | ||
|
||
key ifNil: [ ^ self ]. | ||
|
||
key := nil. | ||
finalizationTime := Time primUTCMicrosecondsClock | ||
] | ||
|
||
{ #category : 'printing' } | ||
IllEphemeron >> printOn: aStream [ | ||
|
||
aStream << allocatedObjectClass name << ' lifetime: ' | ||
<< self lifetimeAsDuration totalSeconds asFloat asString << ' seconds' << ' weights ' | ||
<< sizeInBytes humanReadableByteSizeString | ||
] | ||
|
||
{ #category : 'accessing' } | ||
IllEphemeron >> sizeInBytes [ | ||
|
||
^ sizeInBytes | ||
] | ||
|
||
{ #category : 'accessing' } | ||
IllEphemeron >> sizeInBytes: anObject [ | ||
|
||
sizeInBytes := anObject | ||
] |
Oops, something went wrong.