From: Dmitrii Z. <dza...@ar...> - 2010-08-15 08:00:19
|
Hi, I'm picking up this thread for hyperguy. These are answers to your questions, Doug: >> Could you share some more detail on what data you want to monitor from these short-lived processes? We would like to get process id and these performance metrics: 1. CPU time: Sigar.getProcCpu() 2. Resident memory: Sigar.getProcMem().getResident() >> We could look at using mechanisms such as netlink on Linux, kqueue on BSD, etc., where we can be notified when a process is created, rather than "polling" the process list. Thanks. We will start looking at them. We would appreciate your ideas about how to use them. >> What is the windows-only solution you're using? We get process id this way: CreateProcess(NULL, this->procData->getCmd(), NULL, // no inheritable process handle NULL, // no inheritable thread handle TRUE, // No handle inheritance creationFlags, NULL, // no parent's env NULL, // No starting directory. &startupInfo, &processInfo); DWORD pid = processInfo.dwProcessId; We get CPU time this way: HANDLE process; CpuInfo.getCPUTime(process); We get working set (not resident memory) this way: PROCESS_MEMORY_COUNTERS pmc; GetProcessMemoryInfo(pHandle, &pmc, sizeof(pmc)) int msize = pmc.WorkingSetSize; -Dmitrii |