[Glass] adding profiling to GemStone

Mariano Martinez Peck marianopeck at gmail.com
Tue Dec 31 06:40:00 PST 2013

On Tue, Dec 31, 2013 at 11:03 AM, Otto Behrens <otto at finworks.biz> wrote:

> Hi,
> I want to reuse the current Seaside-Pharo-Development-Core-Profiler
> classes in GemStone. So I moved the general classes to
> Seaside-Development-Core-Profiler and created a hook that implements
> Pharo and GemStone specific profiling in
> Seaside-Pharo-Development-Core-Profiler and
> Seaside-GemStone-Core-Profiler respectively.
> I made some changes in Seaside-Development and
> Seaside-Pharo-Development here: https://github.com/finworks/Seaside30.
> Is this change helpful for Seaside?
> The GemStone version is simplistic at the moment; I'm really battling
> to get it to work in GemStone. My problem is that the block being
> profiled does not return; the response notification seem to block in
> GemStone and does not return in #handleFiltered:. I would like to
> incorporate ProfMonitor, but I'm not even getting as far as measuring
> the time it took to execute #handleFiltered:.
> Does anyone have an idea how I can profile seaside requests in GemStone?
I think (I am not sure) that what I did was to simply surround the
#handleRequest: of the adaptor I was using with a ProfMonitor script.
Example...I modify WAServerAdaptor:

WAServerAdaptor >> handleRequest: aRequestContext
"Pass the request context to the appropriate request handler."

| profMon |
profMon := ProfMonitorTree new.
profMon interval: 10.
 profMon startMonitoring.

[ self requestHandler handle: aRequestContext ]
on: WAResponseNotification
do: [ :n | "got a response" ].


(FileStream forceNewFileNamed: '/Users/mariano/requestProfile.txt')
nextPutAll: (profMon reportDownTo: 100); cr.

Notice that I remember doing this in the Zinc adaptor but I guess it would
be fine here as well.

Ideally, I would love an inspect here at the end to inspect the results in
GemTools, but since it runs in its own gem it is difficult to get an
inspector in GemTools (we discussed this with Dale in a separate mail). So
I simply write the string to a file.

The profile also write is own file with the results. Send #fileName to the
monitor and you would get something like '/tmp/gem26398.pro'. I thought I
could recreate back a profiler instance and open the results with such a
file, but i didn't find it. That's why for the moment I was simply writing
the string into a file.

Hope this helps,

> Thanks
> Otto
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20131231/2c990164/attachment.html>

More information about the Glass mailing list