Skip to content

Commit

Permalink
Added exporting methods to export the finalization profiler data to csv
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanmontt committed Jan 18, 2024
1 parent cd7427e commit 5afe45a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/IllimaniProfiler/IllEphemeron.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ IllEphemeron >> finalizationTime: anObject [
finalizationTime := anObject
]

{ #category : 'serialization' }
IllEphemeron >> flatInstanceVariables [

^ {
finalizationTime asString.
sizeInBytes asString.
initializationTime asString.
allocatedObjectClass asString.
survivedScavenges asString.
survivedFullGC asString.
forcedFinalization asString }
]

{ #category : 'finalization' }
IllEphemeron >> forceFinalization [

Expand All @@ -56,6 +69,13 @@ IllEphemeron >> forcedFinalization [
^ forcedFinalization
]

{ #category : 'serialization' }
IllEphemeron >> headerToExportCSV [

^ #( #finalizationTime #sizeInBytes #initializationTime #allocatedObjectClass
#survivedScavenges #survivedFullGC #forcedFinalization )
]

{ #category : 'accessing' }
IllEphemeron >> initializationTime [

Expand Down
15 changes: 15 additions & 0 deletions src/IllimaniProfiler/IllFinalizationProfiler.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ Class {
#tag : 'Finalization-Profiler'
}

{ #category : 'serialization' }
IllFinalizationProfiler >> exportData [

| writer csvFile fileName |
fileName := DateAndTime now asString , '.csv'.
csvFile := fileName asFileReference createFile writeStream.
writer := NeoCSVWriter on: csvFile.
writer writeHeader: ephemeronsCollection first headerToExportCSV.

ephemeronsCollection do: [ :anIllEphemeron |
writer nextPut: anIllEphemeron flatInstanceVariables ].

writer close
]

{ #category : 'profiling' }
IllFinalizationProfiler >> forceFinalizationOfObjects [

Expand Down

0 comments on commit 5afe45a

Please sign in to comment.