[Seaside] Re: [Glass] adding profiling to GemStone

Otto Behrens otto at finworks.biz
Thu Jan 2 13:30:12 UTC 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:
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.


More information about the seaside mailing list