Hi,
How can i refresh a WMI Performance counter?
This is my code:
CComPtr< IEnumWbemClassObject > enumerator;
hr = service->ExecQuery( L"WQL", L"SELECT * FROM Win32_PerfFormattedData_PerfOS_Processor, WBEM_FLAG_FORWARD_ONLY, NULL,enumerator );
ULONG retcnt;
CComPtr< IWbemClassObject > processor;
hr = enumerator->Next( WBEM_INFINITE, 1L, &processor, &retcnt );
now from the processor i can get "InterruptsPerSec" for example.
but if i want the average of it for an interval, i should sleep for an interval and after that refresh the performance counter to get the new value.
To refresh i need a IWbemRefresher. How can i get one from IWbemClassObject?
Thanks alot
Hisham
How can i refresh a WMI Performance counter?
This is my code:
CComPtr< IEnumWbemClassObject > enumerator;
hr = service->ExecQuery( L"WQL", L"SELECT * FROM Win32_PerfFormattedData_PerfOS_Processor, WBEM_FLAG_FORWARD_ONLY, NULL,enumerator );
ULONG retcnt;
CComPtr< IWbemClassObject > processor;
hr = enumerator->Next( WBEM_INFINITE, 1L, &processor, &retcnt );
now from the processor i can get "InterruptsPerSec" for example.
but if i want the average of it for an interval, i should sleep for an interval and after that refresh the performance counter to get the new value.
To refresh i need a IWbemRefresher. How can i get one from IWbemClassObject?
Thanks alot
Hisham