Vinit Rai
Vinit Rai

Reputation: 25

Not able to get SSAS specific performance counter categories with c#

I want to retrieve Performance counters of SSAS Service. I can see these counters, distributed into multiple categories in my perfmon. Also I have checked my registry key and found these counters. But I am not able to retrieve these counters with C#.

Here is the sample code snippet that I am using-

foreach (PerformanceCounterCategory pcc in PerformanceCounterCategory.GetCategories())
{
     if (pcc.CategoryName.StartsWith("MSOLAP"))
     {
         Console.WriteLine(pcc.CategoryName);
     }
}

Note

In my Perfmon I can see Counter Categories as

Is it possible to see two different list of counters at two places i.e in perfmon & in C# (PerformanceCounterCategory class)

Is there any Existing WMI class for SSAS which can be used to retrieve these counters.

Upvotes: 0

Views: 397

Answers (1)

Alberto Spelta
Alberto Spelta

Reputation: 3678

SSAS on a 64bit environment installs only the 64bit counter's library so, if you run your code from a 32bit application or you are using 32bit version of Windows PerfMon, you can not access those counters.

On a 64-bit platform you have both versions of Windows Perfmon.

  • 32bit -> C:\Windows\SysWOW64\perfmon.exe
  • 64bit -> C:\Windows\System32\perfmon.exe

The solution is to build your application using x64 as the target platform.

Upvotes: 2

Related Questions