Ayende @ Rahien

My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:


+972 52-548-6969

, @ Q c

Posts: 6,026 | Comments: 44,842

filter by tags archive

Non invasive Windows event tracing listening?

time to read 2 min | 250 words

One of the things that I would like to do with L2S Prof is to figure out how to detect row counts and query duration. The problem is that there is absolutely no way of doing that at the Linq to SQL level.

So one of the things that I have been researching is trying to get to the tracing that are present at the System.Data.SqlClient level. For more information about those, you can read this article, which explains them in depth. Basically, Windows comes with a really good support for optional tracing, and System.Data.SqlClient makes use of that in order to trace out a lot of information, including what I would need in order to provide row counts and query duration.

The problem?

Enabling this support is a very invasive process, requiring multiple steps and affecting the entire machine. What I would really like to do is to find some way of tracing those events by flipping a switch inside the application that I am running, and then gathering the interesting stuff inside the same application. I don’t want to muck around with machine global settings.

Right now, I don’t see any way of doing that, so I think that I am going to leave it as that for now.

If anyone can point me to how to do it, I’ll add those capabilities to L2S Prof, but until that happens, I am afraid they aren’t going to be there :-(


Ayende Rahien



This is awesome. I actually resolve the issue using a different method, but that would be quite handy indeed

Neil Barnwell

Have you tried adding things to the local app.config (I'm sure this could be done programatically, too):



The Typemock CThru engine should be perfect for that job

Comment preview

Comments have been closed on this topic.


No future posts left, oh my!


  1. Technical observations from my wife (3):
    13 Nov 2015 - Production issues
  2. Production postmortem (13):
    13 Nov 2015 - The case of the “it is slow on that machine (only)”
  3. Speaking (5):
    09 Nov 2015 - Community talk in Kiev, Ukraine–What does it take to be a good developer
  4. Find the bug (5):
    11 Sep 2015 - The concurrent memory buster
  5. Buffer allocation strategies (3):
    09 Sep 2015 - Bad usage patterns
View all series


Main feed Feed Stats
Comments feed   Comments Feed Stats