可以使用哪個WMI查詢來獲取正在運行的httpd服務的性能信息?用於獲取正在運行的服務器的性能的WMI查詢
hres = pSvc->ExecQuery(
bstr_t("WQL"),
bstr_t("SELECT * FROM Win32_PerfFormattedData_PerfProc_Process Where Name='httpd'"),
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
NULL,
&pEnumerator);
IWbemClassObject *pclsObj;
ULONG uReturn = 0;
while (pEnumerator)
{
HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1,
&pclsObj, &uReturn);
if(0 == uReturn)
{
break;
}
VARIANT vtProp;
// Get the value of the Name property
hr = pclsObj->Get(L"Name", 0, &vtProp, 0, 0);
wcout << " test : " << vtProp.bstrVal << endl;
VariantClear(&vtProp);
pclsObj->Release();
}
我應該按順序使用哪個屬性來知道我的服務的性能? – karikari 2011-03-15 08:48:31