none
Can't seem to add sqlclient counters to perfmon RRS feed

  • Question

  •  

    I've been trying to look at connection pooling in the Performance Monitor (I'm on Vista Ultimate) and have added in all of the SQLClient connection items, but they don't show up ont he bottom portion of the screen (where you can see a list of everytihng you are watching).

     

    I'm running tests from VS2008 and VS2005 that do classic ado.net data access. But nothing is showing at all in the monitor.

     

    I have found many blogs, articles and forums threads about how just click and add these but can't find any discussion of why they wouldn't appear.

     

    I'm on Vista Ultimate. I ran PerfMon as an admin. I have UAC off.

     

    Any ideas?

     

    thanks

     

    julie

    Saturday, June 28, 2008 9:26 PM

Answers

  •  

    Currently, you will see two sets of perf counters in perfmon:

    1. The first one has the category name = ".NET CLR Data". Instances of this category are created and updated only with .NET 1.0 and 1.1 app

     

    2. The new set of categories is ".Net Data Provider for SqlServer" & ".Net Data Provider for Oracle". They will change only if you run .Net 2.0, 3.0 or 3.5 applications.

     

    You can access both sets either programmatically or using perfmon tool - it does not matter. The way you read perf counters in windows does not depend on their name - all you need is the category name, instance name and the counter name.

     

    Tip: if your application is GUI application, you do not need the debugger to keep the instance alive, just keep the GUI open (or the application running in background somehow). If it is immediately exits, then you need some way to pause it to see the instance name in perfmon,

     

    Let me know if you have more questions.

     

    Regards,

     Nissim

    Tuesday, July 8, 2008 8:18 PM
    Moderator

All replies

  •  

    SqlClient performance counters are instance-specific. To see the counters, your application should be running and at least one connection attempt should be made (to initialize the instance).

     

    * Run the application, try one or more connection attempts

    * open perfmon

    * when adding the counters, select the Instance name which will be the same as your application name

     

    Monday, July 7, 2008 11:51 PM
    Moderator
  • Hi Nissim.

     

    Sorry for unmarking your reply, but it truly doesn't work this way for me.

     

    Here's my test:

    •  start my app.
    •  do something that executes a command.
    •  leave my debugger sitting on a line of code prior to closing the connection.
    •  verify that I still have a connection open via SQL Profiler
    • start perfmon
    • add counters
    • select the connection pool counters.

    Not one of Sql Client COnnecton Pool countes has an instance listed, so I can't select a particular instance. They all just say <all Instances> and <No Instances>.

     

    What should I do next?

     

    thanks!

     

    Julie

     

     

    Tuesday, July 8, 2008 5:44 PM
  • Sorry, I forgot to mention that since ADO.Net 2.0 the performance counters has been changed.

     

    http://msdn.microsoft.com/en-us/library/ms254503(VS.80).aspx

     

    Search for counters under category name:

    ".NET Data Provider for SQL Server"

    ".NET Data Provider for Oracle Server"

     

    The article also describes how to access the counters programmatically.

     

    Let me know if this helped. 

    Tuesday, July 8, 2008 6:52 PM
    Moderator
  •  

    Does that mean that the reason it's not working is that these perf counters that are already in perfmon can't be used against ADO.NET 2.0+?

     

    I'm familiar with implementing them programmatically, but I just wanted to leverage an existing resource.

     

    Perhaps the answer is that those counters only work with ado.net 1 and ado.net 1.1 and the only way to do this now is by embedding perf counters into my code. Is that the correct conclusion?

     

    THanks.

     

    julie

    Tuesday, July 8, 2008 7:38 PM
  •  

    Currently, you will see two sets of perf counters in perfmon:

    1. The first one has the category name = ".NET CLR Data". Instances of this category are created and updated only with .NET 1.0 and 1.1 app

     

    2. The new set of categories is ".Net Data Provider for SqlServer" & ".Net Data Provider for Oracle". They will change only if you run .Net 2.0, 3.0 or 3.5 applications.

     

    You can access both sets either programmatically or using perfmon tool - it does not matter. The way you read perf counters in windows does not depend on their name - all you need is the category name, instance name and the counter name.

     

    Tip: if your application is GUI application, you do not need the debugger to keep the instance alive, just keep the GUI open (or the application running in background somehow). If it is immediately exits, then you need some way to pause it to see the instance name in perfmon,

     

    Let me know if you have more questions.

     

    Regards,

     Nissim

    Tuesday, July 8, 2008 8:18 PM
    Moderator