none
PerformanceCounterCategory.GetCategories() seems not return all Performance Counter categories RRS feed

  • Question

  • PerformanceCounterCategory.GetCategories() seems not return all Performance Counter categories.
    I registered 2 custom Performance Counter categories using "lodctr".
    I can see them in perfmon,I can set value in my c++ project.It seems work fine.
    But I cann't get them in my c# project using "PerformanceCounterCategory.GetCategories()".And I found that there are some other categories not returned by "PerformanceCounterCategory.GetCategories()",such as
    HTTP Service
    HTTP Service Url Groups
    HTTP Service Request Queues
    ServiceModelEndpoint 4.0.0.0
    ServiceModelOperation 4.0.0.0
    ServiceModelService 4.0.0.0

    My code is runnnig on  win7 x64,vs2010
    I'm sure this not a  UAC issue,I disabled it.

    here is my manifest:

    <!-- <?xml version="1.0" encoding="UTF-16"?> -->
    <instrumentationManifest     
        xmlns="http://schemas.microsoft.com/win/2004/08/events" 
        xmlns:win="http://manifests.microsoft.com/win/2004/08/windows/events"
        xmlns:xs="http://www.w3.org/2001/XMLSchema" >
        <instrumentation>
          <counters xmlns="http://schemas.microsoft.com/win/2005/12/counters" schemaVersion="1.1" >
             <provider callback = "custom"
                  applicationIdentity = "CubeRes.exe"
                  providerType = "userMode"
                  providerGuid = "{3cf4cd05-09de-4c53-880e-495f2716b991}" 
                  symbol="CubeResProvider">
                    <counterSet guid = "{eeff6a41-a2af-4f20-b79d-7e24dff8fde3}"
                      uri = "CROOTWAY.PerfCounters.CubeRes.QueueSet"
                      name = "CBS.CubeRes.QueueSet" 
                      description = "This is a counter set of Queue with multiple instances." 
                      instances = "multiple" 
                      symbol="QueueSet">
                        <counter id = "1" 
                          name = "BlockingMode"
                          uri = "CROOTWAY.PerfCounters.CubeRes.QueueSet.BlockingMode"
                          description = "BlockingMode of Queue"
                          type = "perf_counter_rawcount"
                          detailLevel = "standard"
                          defaultScale = "0"/>
                        <counter id = "2"
                          name = "BlockCount"
                          uri = "CROOTWAY.PerfCounters.CubeRes.QueueSet.BlockCount"
                          description = "BlockCount of Queue"
                          type = "perf_counter_rawcount"
                          detailLevel = "standard"
                          defaultScale = "0"/>                      
                        <counter id = "3" 
                          name = "BlockSize"
                          uri = "CROOTWAY.PerfCounters.CubeRes.QueueSet.BlockSize"
                          description = "BlockSize of Queue"
                          type = "perf_counter_rawcount"
                          detailLevel = "standard"
                          defaultScale = "0"/>
                        <counter id = "4" 
                          name = "BlockSeek"
                          uri = "CROOTWAY.PerfCounters.CubeRes.QueueSet.BlockSeek"
                          description = "BlockSeek of Queue"
                          type = "perf_counter_rawcount"
                          detailLevel = "standard"
                          defaultScale = "0"/>
                        <counter id = "5" 
                          name = "BlockPeek"
                          uri = "CROOTWAY.PerfCounters.CubeRes.QueueSet.BlockPeek"
                          description = "BlockPeek of Queue"
                          type = "perf_counter_rawcount"
                          detailLevel = "standard"
                          defaultScale = "0"/>
                        <counter id = "6" 
                          name = "FreeBlockCount"
                          uri = "CROOTWAY.PerfCounters.CubeRes.QueueSet.FreeBlockCount"
                          description = "FreeBlockCount of Queue"
                          type = "perf_counter_rawcount"
                          detailLevel = "standard"
                          defaultScale = "0"/>  
                        <counter id = "7" 
                          name = "BlockCycle"
                          uri = "CROOTWAY.PerfCounters.CubeRes.QueueSet.BlockCycle"
                          description = "BlockCycle of Queue"
                          type = "perf_counter_rawcount"
                          detailLevel = "standard"
                          defaultScale = "0"/>
                    </counterSet>
                    <counterSet guid = "{0e5a7a20-0b89-4ce5-b986-eec039ce981a}"
                      uri = "CROOTWAY.PerfCounters.CubeRes.SHMSet"
                      name = "CBS.CubeRes.SHMSet" 
                      description = "This is a counter set of ShareMemory with multiple instances." 
                      instances = "multiple" 
                      symbol="SHMSet">
                        <counter id = "1" 
                          name = "Size"
                          uri = "CROOTWAY.PerfCounters.CubeRes.SHMSet.Size"
                          description = "Size of ShareMemory"
                          type = "perf_counter_rawcount"
                          detailLevel = "standard"
                          defaultScale = "0"/>                   
                        <counter id = "2" 
                          name = "MaxRecord"
                          uri = "CROOTWAY.PerfCounters.CubeRes.SHMSet.MaxRecord"
                          description = "MaxRecordCount of ShareMemory"
                          type = "perf_counter_rawcount"
                          detailLevel = "standard"
                          defaultScale = "0"/>
                        <counter id = "3"
                          name = "RecordCount"
                          uri = "CROOTWAY.PerfCounters.CubeRes.SHMSet.RecordCount"
                          description = "RecordCount of ShareMemory"
                          type = "perf_counter_rawcount"
                          detailLevel = "standard"
                          defaultScale = "0"/>    
                    </counterSet>              
              </provider>
            </counters>
        </instrumentation>
    </instrumentationManifest>

    • Moved by Mike FengModerator Tuesday, October 23, 2012 10:50 AM BCL (From:Common Language Runtime)
    Monday, October 22, 2012 10:04 AM

Answers

  • Hi,

    We have reviewed the question and end results here.   The behavior being observed is unexpected for the x64 build.  

    This looks to be something specific to the machine as this should be working if the counter is installed via doing the setup as a 64-bit setup.

    We can look further at the machine via technical support through the assisted support channel:
        https://gettechsupport.microsoft.com/Default.aspx?pesid=14694


    Thanks,
    Nathan Manis

    • Marked as answer by 李萌 Monday, November 12, 2012 3:51 AM
    Wednesday, November 7, 2012 5:54 PM

All replies