本文整理汇总了C++中CJob::QueryExtendedLimitInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CJob::QueryExtendedLimitInfo方法的具体用法?C++ CJob::QueryExtendedLimitInfo怎么用?C++ CJob::QueryExtendedLimitInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CJob
的用法示例。
在下文中一共展示了CJob::QueryExtendedLimitInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: JobNotify
//.........这里部分代码省略.........
s_nStatusCount++);
ListBox_SetCurSel(hwndLB, ListBox_AddString(hwndLB, sz));
/* Show the basic accounting information */
JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION jobai;
g_job.QueryBasicAccountingInfo(&jobai);
StringCchPrintf(
sz,
_countof(sz),
TEXT("Total Time: User=%I64u, Kernel=%I64u ")
TEXT("Period Time: User=%I64u, Kernel=%I64u"),
jobai.BasicInfo.TotalUserTime.QuadPart,
jobai.BasicInfo.TotalKernelTime.QuadPart,
jobai.BasicInfo.ThisPeriodTotalUserTime.QuadPart,
jobai.BasicInfo.ThisPeriodTotalKernelTime.QuadPart);
ListBox_SetCurSel(hwndLB, ListBox_AddString(hwndLB, sz));
StringCchPrintf(
sz,
_countof(sz),
TEXT("Page Faults=%u, Total Processes=%u, ")
TEXT("Active Processes=%u, Terminated Processes=%u"),
jobai.BasicInfo.TotalPageFaultCount,
jobai.BasicInfo.TotalProcesses,
jobai.BasicInfo.ActiveProcesses,
jobai.BasicInfo.TotalTerminatedProcesses);
ListBox_SetCurSel(hwndLB, ListBox_AddString(hwndLB, sz));
/* Show the I/O accounting information */
StringCchPrintf(
sz,
_countof(sz),
TEXT("Reads=%I64u (%I64u bytes), ")
TEXT("Write=%I64u (%I64u bytes), Other=%I64u (%I64u bytes)"),
jobai.IoInfo.ReadOperationCount,
jobai.IoInfo.ReadTransferCount,
jobai.IoInfo.WriteOperationCount,
jobai.IoInfo.WriteTransferCount,
jobai.IoInfo.OtherOperationCount,
jobai.IoInfo.OtherTransferCount);
ListBox_SetCurSel(hwndLB, ListBox_AddString(hwndLB, sz));
/* Show the peak per-process and job memory usage */
JOBOBJECT_EXTENDED_LIMIT_INFORMATION joeli;
g_job.QueryExtendedLimitInfo(&joeli);
StringCchPrintf(
sz,
_countof(sz),
TEXT("Peak memory used: Process=%I64u, Job=%I64u"),
(__int64)joeli.PeakProcessMemoryUsed,
(__int64)joeli.PeakJobMemoryUsed);
ListBox_SetCurSel(hwndLB, ListBox_AddString(hwndLB, sz));
/* Show the set of Process IDs */
DWORD dwNumProcesses = 50;
DWORD dwProcessIdList[50];
g_job.QueryBasicProcessIdList(
dwNumProcesses,
dwProcessIdList,
&dwNumProcesses);
StringCchPrintf(
sz,
_countof(sz),
TEXT("PIDs: %s"),
(dwNumProcesses == 0) ? TEXT("(none)") : TEXT(""));
ListBox_SetCurSel(hwndLB, ListBox_AddString(hwndLB, sz));
TCHAR szProcessName[MAX_PATH];
for (DWORD x = 0; x < dwNumProcesses; x++)
{
GetProcessName(
dwProcessIdList[x],
szProcessName,
_countof(szProcessName));
StringCchPrintf(
sz,
_countof(sz),
TEXT(" %d - %s"),
dwProcessIdList[x],
szProcessName);
ListBox_SetCurSel(hwndLB, ListBox_AddString(hwndLB, sz));
}
}
}
return(0);
}
开发者ID:melvinvarkey,项目名称:ANCI_C_Training,代码行数:101,代码来源:JobLab.cpp本文标签属性:
示例:示例是什么意思
代码:代码零九
CJob:cjob系列
QueryExtendedLimitInfo:QueryExtendedLimitInfo