I get the following error when I query for "Processor Queue Length" using the PdhValidatePath API.
PdhValidatePath failed with error c0000bb9 for the path: \System\Processor Queue Length.
Any idea, what is going wrong here?
Machine is a physical machine with 2 CPU Sockets (AMD EPYC 7742, 2.25GHz, 64C/128T, Socket SP3
OS is Windows Server 2016 Standard
Method of query is
counter_name= "\System\Processor Queue Length"
PdhValidatePath(counter_name)
PdhValidatePath failed with error c0000bb9 for the path: \System\Processor Queue Length.
PDH_CSTATUS_NO_COUNTER = c0000bb9
The specified counter was not found in the specified object. If this status is returned when the counter is being added, then the counter is not added to the query. If this status is returned after data collection, the data for that counter is invalid. Each time the data is requested, PDH tries to obtain this counter data.
I looked for the path using command below and confirmed that it is present
typeperf -q | findstr System
\System\Processor Queue Length
Another thing is I get 404 error for the below link
https://learn.microsoft.com/en-us/windows/win32/api/pdh/nf-pdh-pdhvalidatepathex