<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 31, 2013 at 11:03 AM, Otto Behrens <span dir="ltr">&lt;<a href="mailto:otto@finworks.biz" target="_blank" class="vt-p">otto@finworks.biz</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
I want to reuse the current Seaside-Pharo-Development-Core-Profiler<br>
classes in GemStone. So I moved the general classes to<br>
Seaside-Development-Core-Profiler and created a hook that implements<br>
Pharo and GemStone specific profiling in<br>
Seaside-Pharo-Development-Core-Profiler and<br>
Seaside-GemStone-Core-Profiler respectively.<br>
<br>
I made some changes in Seaside-Development and<br>
Seaside-Pharo-Development here: <a href="https://github.com/finworks/Seaside30" target="_blank" class="vt-p">https://github.com/finworks/Seaside30</a>.<br>
<br>
Is this change helpful for Seaside?<br>
<br>
The GemStone version is simplistic at the moment; I&#39;m really battling<br>
to get it to work in GemStone. My problem is that the block being<br>
profiled does not return; the response notification seem to block in<br>
GemStone and does not return in #handleFiltered:. I would like to<br>
incorporate ProfMonitor, but I&#39;m not even getting as far as measuring<br>
the time it took to execute #handleFiltered:.<br>
<br>
Does anyone have an idea how I can profile seaside requests in GemStone?<br>
<br></blockquote><div><br></div><div>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. </div><div>Example...I modify WAServerAdaptor:</div>
<div><br></div><div><div>WAServerAdaptor &gt;&gt; handleRequest: aRequestContext</div><div><span class="" style="white-space:pre">        </span>&quot;Pass the request context to the appropriate request handler.&quot;</div><div>
<br></div><div><br></div><div>| profMon |</div><div>profMon := ProfMonitorTree new.</div><div>profMon interval: 10.</div><div> profMon startMonitoring.</div><div><br></div><div><span class="" style="white-space:pre">        </span>[ self requestHandler handle: aRequestContext ]</div>
<div><span class="" style="white-space:pre">                </span>on: WAResponseNotification</div><div><span class="" style="white-space:pre">                </span>do: [ :n | &quot;got a response&quot; ].</div><div><br></div><div><span class="" style="white-space:pre">        </span> profMon</div>
<div>        stopMonitoring;</div><div>        gatherResults.</div><div><br></div><div>(FileStream forceNewFileNamed: &#39;/Users/mariano/requestProfile.txt&#39;) nextPutAll: (profMon reportDownTo: 100); cr.</div><div><br>
</div><div><br></div><div>Notice that I remember doing this in the Zinc adaptor but I guess it would be fine here as well. </div><div><br></div></div><div>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. </div>
<div><br></div><div>The profile also write is own file with the results. Send #fileName to the monitor and you would get something like &#39;/tmp/<a href="http://gem26398.pro">gem26398.pro</a>&#39;. I thought I could recreate back a profiler instance and open the results with such a file, but i didn&#39;t find it. That&#39;s why for the moment I was simply writing the string into a file.</div>
<div><br></div><div>Hope this helps,</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Thanks<br>
Otto<br>
_______________________________________________<br>
Glass mailing list<br>
<a href="mailto:Glass@lists.gemtalksystems.com" class="vt-p">Glass@lists.gemtalksystems.com</a><br>
<a href="http://lists.gemtalksystems.com/mailman/listinfo/glass" target="_blank" class="vt-p">http://lists.gemtalksystems.com/mailman/listinfo/glass</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><br>
</div></div>