Skip to content

Commit

Permalink
Added profiled block code to the metadata to have more information wh…
Browse files Browse the repository at this point in the history
…en exporting
  • Loading branch information
jordanmontt committed Jan 31, 2024
1 parent 92a037a commit d9214ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/IllimaniProfiler/IllAbstractProfiler.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Class {
'vmStats',
'totalTime',
'startTime',
'proxyCopy'
'proxyCopy',
'profiledCode'
],
#category : 'IllimaniProfiler-Instrumentation',
#package : 'IllimaniProfiler',
Expand Down Expand Up @@ -126,6 +127,7 @@ IllAbstractProfiler >> profileFor: aDuration [
{ #category : 'api' }
IllAbstractProfiler >> profileOn: aBlock [

profiledCode := aBlock asString.
self startProfiling.
"The nil at the end is necessary because else the value of the block is referenced inside
the ensure: method. We don't want to keep the reference because it avoids the object from
Expand Down
1 change: 1 addition & 0 deletions src/IllimaniProfiler/IllFinalizationProfiler.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ IllFinalizationProfiler >> exportMetaData: fileName [
| tempDict jsonString writeStream |
tempDict := { ('totalExecutionTime' -> totalTime).
('totalFullGCs' -> self totalFullGCs).
('profiledCode' -> profiledCode).
('totalScavenges' -> self totalScavenges).
('sampligRate' -> samplingRate) } asDictionary.
jsonString := NeoJSONWriter toStringPretty: tempDict.
Expand Down

0 comments on commit d9214ce

Please sign in to comment.