Ayende @ Rahien

It's a girl

Non invasive Windows event tracing listening?

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 :-(

Comments

Ayende Rahien
11/14/2009 11:19 AM by
Ayende Rahien

Harry,

Wow!

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

Neil Barnwell
11/14/2009 10:42 PM by
Neil Barnwell

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

<system.diagnostics
<sources
<source
<listeners

Roy
11/16/2009 09:03 PM by
Roy

The Typemock CThru engine should be perfect for that job

Comments have been closed on this topic.