Skip to content

Commit

Permalink
Improved exporting methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanmontt committed Feb 13, 2024
1 parent d78541a commit 0fb68a4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
13 changes: 5 additions & 8 deletions src/IllimaniProfiler/GCLogger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ Class {
{ #category : 'exporting' }
GCLogger >> export: writeStream data: someData header: aHeaderInCollection [

| writer |
writer := NeoCSVWriter on: writeStream.

writer writeHeader: #( #fullGCsBySecond ).
fullGCs do: [ :aNumber |
writer nextPut: aNumber ].

writer close
(NeoCSVWriter on: writeStream)
writeHeader: #( #fullGCsBySecond );
fieldWriter: #raw;
nextPut: someData;
close
]

{ #category : 'exporting' }
Expand Down
14 changes: 7 additions & 7 deletions src/IllimaniProfiler/IllEphemeron.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ IllEphemeron >> finalizationTime: anObject [
IllEphemeron >> flatInstanceVariables [

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

{ #category : 'finalization' }
Expand Down
10 changes: 6 additions & 4 deletions src/IllimaniProfiler/IllFinalizationProfiler.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ IllFinalizationProfiler >> exportEphemerons: fileName [

| writeStream writer |
writeStream := fileName asFileReference createFile writeStream.
writer := NeoCSVWriter on: writeStream.

writer writeHeader: ephemeronsCollection first headerToExportCSV.
writer := (NeoCSVWriter on: writeStream)
writeHeader: ephemeronsCollection first headerToExportCSV;
fieldWriter: #raw;
yourself.

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

Expand Down Expand Up @@ -99,8 +101,8 @@ IllFinalizationProfiler >> objectAllocations [
{ #category : 'profiling' }
IllFinalizationProfiler >> startProfiling [

gcLogger := GCLogger new run.
super startProfiling.
gcLogger := GCLogger new run
]

{ #category : 'accessing - statistics' }
Expand Down

0 comments on commit 0fb68a4

Please sign in to comment.