<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Timing JSF Requests Using a Phase Listener</title>
	<atom:link href="http://www.andygibson.net/blog/tutorial/timing-jsf-requests-using-a-phase-listener/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.andygibson.net/blog/tutorial/timing-jsf-requests-using-a-phase-listener/</link>
	<description>Open Source Projects &#38; Technical Writings</description>
	<lastBuildDate>Wed, 18 Jan 2012 00:05:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dmtiri</title>
		<link>http://www.andygibson.net/blog/tutorial/timing-jsf-requests-using-a-phase-listener/comment-page-1/#comment-16066</link>
		<dc:creator>Dmtiri</dc:creator>
		<pubDate>Sat, 26 Mar 2011 15:02:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=295#comment-16066</guid>
		<description>better will be like this
public void afterPhase(PhaseEvent event) {
12	            if (!log.isDebugEnabled()) return;
09	        if (event.getPhaseId() == PhaseId.RENDER_RESPONSE) {
10	            long endTime = System.nanoTime();
11	            long diffMs = (long) ((endTime - startTime) * 0.000001);
13	                log.debug(&quot;Execution Time = &quot; + diffMs + &quot;ms&quot;);
15	        }
17	        log.debug(&quot;Executed Phase &quot; + event.getPhaseId());
19	    }</description>
		<content:encoded><![CDATA[<p>better will be like this<br />
public void afterPhase(PhaseEvent event) {<br />
12	            if (!log.isDebugEnabled()) return;<br />
09	        if (event.getPhaseId() == PhaseId.RENDER_RESPONSE) {<br />
10	            long endTime = System.nanoTime();<br />
11	            long diffMs = (long) ((endTime &#8211; startTime) * 0.000001);<br />
13	                log.debug(&#8220;Execution Time = &#8221; + diffMs + &#8220;ms&#8221;);<br />
15	        }<br />
17	        log.debug(&#8220;Executed Phase &#8221; + event.getPhaseId());<br />
19	    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Gibson</title>
		<link>http://www.andygibson.net/blog/tutorial/timing-jsf-requests-using-a-phase-listener/comment-page-1/#comment-15999</link>
		<dc:creator>Andy Gibson</dc:creator>
		<pubDate>Thu, 20 Jan 2011 04:43:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=295#comment-15999</guid>
		<description>Hey Daniel, 

Yes, you are correct, this isn&#039;t thread safe which I don&#039;t worry about since I never deploy this into production. I just use it for development to see when I wrote some code that is slow. You could pop the timestamp into the session and read it back in when the phase is complete. 

Cheers,

Andy Gibson</description>
		<content:encoded><![CDATA[<p>Hey Daniel, </p>
<p>Yes, you are correct, this isn&#8217;t thread safe which I don&#8217;t worry about since I never deploy this into production. I just use it for development to see when I wrote some code that is slow. You could pop the timestamp into the session and read it back in when the phase is complete. </p>
<p>Cheers,</p>
<p>Andy Gibson</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Camilo Correa</title>
		<link>http://www.andygibson.net/blog/tutorial/timing-jsf-requests-using-a-phase-listener/comment-page-1/#comment-15996</link>
		<dc:creator>Camilo Correa</dc:creator>
		<pubDate>Tue, 18 Jan 2011 19:28:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=295#comment-15996</guid>
		<description>Agree with @Daniel... just one instance of listener. Just use this solution in a controlled envirnonment... never as diagnostic tool in production</description>
		<content:encoded><![CDATA[<p>Agree with @Daniel&#8230; just one instance of listener. Just use this solution in a controlled envirnonment&#8230; never as diagnostic tool in production</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.andygibson.net/blog/tutorial/timing-jsf-requests-using-a-phase-listener/comment-page-1/#comment-15977</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Thu, 16 Dec 2010 10:43:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=295#comment-15977</guid>
		<description>Hi, isn&#039;t there only one instance of this and shared accross all users and requests which would then mean that the private field startTime will be overwritten with each request?</description>
		<content:encoded><![CDATA[<p>Hi, isn&#8217;t there only one instance of this and shared accross all users and requests which would then mean that the private field startTime will be overwritten with each request?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Gibson</title>
		<link>http://www.andygibson.net/blog/tutorial/timing-jsf-requests-using-a-phase-listener/comment-page-1/#comment-14504</link>
		<dc:creator>Andy Gibson</dc:creator>
		<pubDate>Tue, 20 Jul 2010 23:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=295#comment-14504</guid>
		<description>This implementation does time the whole lifecycle from restore view to the completion of the rendering. Reading back the post, it does say it logs the end of each phase, but it only writes out the the log file the end of each phase. 

Cheers,

Andy Gibson</description>
		<content:encoded><![CDATA[<p>This implementation does time the whole lifecycle from restore view to the completion of the rendering. Reading back the post, it does say it logs the end of each phase, but it only writes out the the log file the end of each phase. </p>
<p>Cheers,</p>
<p>Andy Gibson</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thiago</title>
		<link>http://www.andygibson.net/blog/tutorial/timing-jsf-requests-using-a-phase-listener/comment-page-1/#comment-14500</link>
		<dc:creator>Thiago</dc:creator>
		<pubDate>Tue, 20 Jul 2010 13:11:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=295#comment-14500</guid>
		<description>I have a question, what if I want to log the total time spent to process all the phases, not the current one? What could be done to achieve this?</description>
		<content:encoded><![CDATA[<p>I have a question, what if I want to log the total time spent to process all the phases, not the current one? What could be done to achieve this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nmatrix9</title>
		<link>http://www.andygibson.net/blog/tutorial/timing-jsf-requests-using-a-phase-listener/comment-page-1/#comment-14342</link>
		<dc:creator>nmatrix9</dc:creator>
		<pubDate>Mon, 25 Jan 2010 02:12:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=295#comment-14342</guid>
		<description>It looks very useful, thanks!</description>
		<content:encoded><![CDATA[<p>It looks very useful, thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

