[Glass] adding profiling to GemStone
Otto Behrens
otto at finworks.biz
Thu Jan 2 05:30:12 PST 2014
>> I made some changes in Seaside-Development and
>> Seaside-Pharo-Development here: https://github.com/finworks/Seaside30.
>>
>> Is this change helpful for Seaside?
>
> Yes, once you have a running version and know which hooks you need.
The version I've got here:
https://github.com/finworks/Seaside30/tree/portProfilerToolToGemStone
works in Pharo. It just moves some code around and created some hooks.
But in GemStone it still hangs. This is the crux of the code:
WAProfilerItem | profile: aBlock
| result |
self startProfiling.
result := self runProfilerOn: aBlock.
self endProfiling.
^ result
WAProfilerItem moved to Seaside-Development. startProfiling and
endProfiling simply records the start and end time stamps.
WAPharoProfilerItem | runProfilerOn: aBlock
tally := MessageTally new.
tally reportOtherProcesses: false.
^ tally spyEvery: 1 on: aBlock
Pharo specific subclass that is in Seaside-Pharo-Development.
WAGemStoneProfilerItem runProfilerOn: aBlock
^ aBlock value
The GS specific subclass in Seaside-GemStone-Development. The idea is
that it runs ProfMonitor. But we're not getting to that point yet.
aBlock value does not return.
WAProfilerFilter | handleFiltered: aRequestContext
| item |
item := self itemClass request: aRequestContext request copy.
[ item profile: [ super handleFiltered: aRequestContext ] ]
ensure: [ items := items copyWith: item ]
The itemClass method is loaded with either Seaside-Pharo-Development
or Seaside-GemStone-Development. Not sure if this is the most elegant
way of getting platform specific behaviour here. If you have a better
one, please let me know.
Thanks
Otto
More information about the Glass
mailing list