<?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 for Beckshome.com: Thomas Beck&#039;s Blog</title>
	<atom:link href="http://www.beckshome.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.beckshome.com</link>
	<description>Musings about technology and things tangentially related</description>
	<lastBuildDate>Mon, 19 Sep 2011 01:28:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Comment on WCF Performance Counter Sizing &#8211; Do the Math by admin</title>
		<link>http://www.beckshome.com/2010/04/wcf-performance-counter-sizing/#comment-44</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Mon, 19 Sep 2011 01:28:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.beckshome.com/?p=921#comment-44</guid>
		<description>Latha&gt; Depending upon the duration and type of the event you&#039;re recording, you might choose to use a performance counter or just plain log file / database. If you use the perf counter, the .NET Framework provides classes for logging to and reading from performance counters. You could also just use a library like NLog that lets you treat a Performance Counter as someplace you can record point-in-time data; no different than a log file or database. Hope this helps!</description>
		<content:encoded><![CDATA[<p>Latha&gt; Depending upon the duration and type of the event you&#8217;re recording, you might choose to use a performance counter or just plain log file / database. If you use the perf counter, the .NET Framework provides classes for logging to and reading from performance counters. You could also just use a library like NLog that lets you treat a Performance Counter as someplace you can record point-in-time data; no different than a log file or database. Hope this helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on WCF Performance Counter Sizing &#8211; Do the Math by Latha</title>
		<link>http://www.beckshome.com/2010/04/wcf-performance-counter-sizing/#comment-40</link>
		<dc:creator>Latha</dc:creator>
		<pubDate>Sat, 17 Sep 2011 11:35:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.beckshome.com/?p=921#comment-40</guid>
		<description>Thanks a lot Thomas. can you share some information on how to create custom performance counters for say - to calculate the average time taken for an operation over a duration.</description>
		<content:encoded><![CDATA[<p>Thanks a lot Thomas. can you share some information on how to create custom performance counters for say &#8211; to calculate the average time taken for an operation over a duration.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Lightweight, Aspect-Oriented Instrumentation with PostSharp, NLog, and SQLite by Willie</title>
		<link>http://www.beckshome.com/2010/04/lightweight-aspect-oriented-instrumentation-with-postsharp-nlog-and-sqlite/#comment-25</link>
		<dc:creator>Willie</dc:creator>
		<pubDate>Wed, 08 Sep 2010 18:37:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.beckshome.com/?p=878#comment-25</guid>
		<description>Thanks for the nice AOP/NLog example...

Just curious, why Push the guid onto the NDC and Pop it off before the call to &quot;Proceed&quot; and then Push/Pop afterwards? I have not used NLog much, but I assume that, having pushed something onto the NDC, that makes it available to be logged via a layout renderer for each message that is logged while the guid is on the stack.  So, when your messages 

log.Info(&quot;{0}() called&quot;, methodName) and log.Info(&quot;{0}() completed&quot;, methodName)

are logged, they will (or can be, depending on your logging format layout) each be tagged with the guid that is specific to this instance of this call.

If you leave the guid in the NDC, any logging inside of the method can also be tagged with the guid.  

Also, I think that if you want to leave the guid in the NDC, you can do something like this (Push returns an IDisposable that does a Pop in its Dispose method):

var log = LogManager.GetCurrentClassLogger();

using (NLog.NDC.Push(Guid.NewGuid())
{
  log.Info(&quot;Entering blah blah&quot;);

  // snip some code here

  try
  {
    eventArgs.Proceed();
  }
  catch (Exception ex)
  {
    //do stuff in case of exception
  }

  NLog.MDC.Set(&quot;Elapsed time ...&quot;);

  log.Info(&quot;Completed blah blah ...&quot;);
}

Thus, the using (NLog.NDC.Push(Guid.NewGuid())) allows the Pop to happen implicitly and also allows all statements inside of the &quot;real&quot; method (eventArgs.Proceed()) to be tagged with the same correlation id.  Of course, if each subsequent layer of the call hierarchy is instrumented similarly, then each new Guid would be pushed onto the stack and, again, the logging statements from a specific level in the hierarchy

Maybe that is not what you were after and you really just want the enter/exit log messages to be tagged with the correlation id.

Anyway, thought I would mention this to see if you have any thoughts on this approach (leaving guid &quot;Push&quot;-ed for whole method call rather than Push/Pop before and Push/Pop after).

Thanks again for the nice AOP/NLog example.</description>
		<content:encoded><![CDATA[<p>Thanks for the nice AOP/NLog example&#8230;</p>
<p>Just curious, why Push the guid onto the NDC and Pop it off before the call to &#8220;Proceed&#8221; and then Push/Pop afterwards? I have not used NLog much, but I assume that, having pushed something onto the NDC, that makes it available to be logged via a layout renderer for each message that is logged while the guid is on the stack.  So, when your messages </p>
<p>log.Info(&#8220;{0}() called&#8221;, methodName) and log.Info(&#8220;{0}() completed&#8221;, methodName)</p>
<p>are logged, they will (or can be, depending on your logging format layout) each be tagged with the guid that is specific to this instance of this call.</p>
<p>If you leave the guid in the NDC, any logging inside of the method can also be tagged with the guid.  </p>
<p>Also, I think that if you want to leave the guid in the NDC, you can do something like this (Push returns an IDisposable that does a Pop in its Dispose method):</p>
<p>var log = LogManager.GetCurrentClassLogger();</p>
<p>using (NLog.NDC.Push(Guid.NewGuid())<br />
{<br />
  log.Info(&#8220;Entering blah blah&#8221;);</p>
<p>  // snip some code here</p>
<p>  try<br />
  {<br />
    eventArgs.Proceed();<br />
  }<br />
  catch (Exception ex)<br />
  {<br />
    //do stuff in case of exception<br />
  }</p>
<p>  NLog.MDC.Set(&#8220;Elapsed time &#8230;&#8221;);</p>
<p>  log.Info(&#8220;Completed blah blah &#8230;&#8221;);<br />
}</p>
<p>Thus, the using (NLog.NDC.Push(Guid.NewGuid())) allows the Pop to happen implicitly and also allows all statements inside of the &#8220;real&#8221; method (eventArgs.Proceed()) to be tagged with the same correlation id.  Of course, if each subsequent layer of the call hierarchy is instrumented similarly, then each new Guid would be pushed onto the stack and, again, the logging statements from a specific level in the hierarchy</p>
<p>Maybe that is not what you were after and you really just want the enter/exit log messages to be tagged with the correlation id.</p>
<p>Anyway, thought I would mention this to see if you have any thoughts on this approach (leaving guid &#8220;Push&#8221;-ed for whole method call rather than Push/Pop before and Push/Pop after).</p>
<p>Thanks again for the nice AOP/NLog example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getting Real &#8211; The Book by Avaliacoes da tifacil</title>
		<link>http://www.beckshome.com/2006/07/getting-real-the-book/#comment-2</link>
		<dc:creator>Avaliacoes da tifacil</dc:creator>
		<pubDate>Mon, 07 Jun 2010 09:50:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.beckshome.com/?p=98#comment-2</guid>
		<description>Good afternoon, thanks for the post? Is your site a free theme or custom? I am intrigued by your site. Is it feasible to include this post on one of my sites?, i will of course linkback to this page. Many Thanks</description>
		<content:encoded><![CDATA[<p>Good afternoon, thanks for the post? Is your site a free theme or custom? I am intrigued by your site. Is it feasible to include this post on one of my sites?, i will of course linkback to this page. Many Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on WCF Performance Counter Sizing &#8211; Do the Math by SQL Server 2008 Data Capture</title>
		<link>http://www.beckshome.com/2010/04/wcf-performance-counter-sizing/#comment-26</link>
		<dc:creator>SQL Server 2008 Data Capture</dc:creator>
		<pubDate>Thu, 06 May 2010 08:09:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.beckshome.com/?p=921#comment-26</guid>
		<description>[...] Beckshome.com: Thomas Beck&#039;s Blog » WCF Performance Counter Sizing &#8211; Do the Math [...] </description>
		<content:encoded><![CDATA[<p>[...] Beckshome.com: Thomas Beck&#39;s Blog » WCF Performance Counter Sizing &#8211; Do the Math [...] </p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: basic
Database Caching 2/7 queries in 0.007 seconds using disk: basic
Object Caching 288/294 objects using disk: basic

Served from: www.beckshome.com @ 2012-05-22 23:31:37 -->
