Hi,
Wondering if there is a way to measure a child process's cpu usage
(sys and user) when the child is still running. I see os.times()
working fine in my system (Linux 2.6.9-42.7.ELsmp), but it gives valid
data only after the child has exited. When the child is alive,
os.times() data for child is zero for both child-sys and child-user
cpu.
My script (process P1) launches child process P2 (using
popen2.Popen3). P2 is a long running process (big compilation). Every
minute or so, from P1, I want to measure how much cpu P2 has consumed
and based on that I can make some estimate on the completion time of
P2 (I have a rough idea how much total cpu P2 needs to complete).
I understand it may be too expensive to update this information to the
parent process when any of the child/grand-child completes; but
wondering if any there is any way to get this info; the expensive
operations is on-demand only when the request is made.
Thanks,
Karthik 2 3432
On Jan 26, 5:43 am, Karthik Gurusamy <kar1...@gmail.comwrote:
Hi,
Wondering if there is a way to measure a child process's cpu usage
(sys and user) when the child is still running. I see os.times()
working fine in my system (Linux 2.6.9-42.7.ELsmp), but it gives valid
data only after the child has exited. When the child is alive,
os.times() data for child is zero for both child-sys and child-user
cpu.
My script (process P1) launches child process P2 (using
popen2.Popen3). P2 is a long running process (big compilation). Every
minute or so, from P1, I want to measure how much cpu P2 has consumed
and based on that I can make some estimate on the completion time of
P2 (I have a rough idea how much total cpu P2 needs to complete).
I understand it may be too expensive to update this information to the
parent process when any of the child/grand-child completes; but
wondering if any there is any way to get this info; the expensive
operations is on-demand only when the request is made.
Thanks,
Karthik
I had a similar requirement in December and found: http://lilypond.org/~janneke/software/
proc-time.c and proc-time.py poll /proc/.... files whilst command
is running to get stats.
Enjoy, - Paddy.
On Jan 25, 11:59 pm, Paddy <paddy3...@googlemail.comwrote:
On Jan 26, 5:43 am, Karthik Gurusamy <kar1...@gmail.comwrote:
Hi,
Wondering if there is a way to measure a child process's cpu usage
(sys and user) when the child is still running. I see os.times()
working fine in my system (Linux 2.6.9-42.7.ELsmp), but it gives valid
data only after the child has exited. When the child is alive,
os.times() data for child is zero for both child-sys and child-user
cpu.
My script (process P1) launches child process P2 (using
popen2.Popen3). P2 is a long running process (big compilation). Every
minute or so, from P1, I want to measure how much cpu P2 has consumed
and based on that I can make some estimate on the completion time of
P2 (I have a rough idea how much total cpu P2 needs to complete).
I understand it may be too expensive to update this information to the
parent process when any of the child/grand-child completes; but
wondering if any there is any way to get this info; the expensive
operations is on-demand only when the request is made.
Thanks,
Karthik
I had a similar requirement in December and found: http://lilypond.org/~janneke/software/
proc-time.c and proc-time.py poll /proc/.... files whilst command
is running to get stats.
Great, thanks. From proc-time.py looks like all I want are the fields
13 to 16 of /proc/<child-pid>/stat. And I see them updated in real
time (probably the kernel does it on a periodic interrupt).
Thanks,
Karthik
>
Enjoy, - Paddy.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Jamie Green |
last post by:
Using MSXML3.0, with the Dom SelectionLanguage set to Xpath I am
trying to query the following document
<Root>
<Child>Name</Child>
<Child>John</Child>
<Child>Smith</Child>
<Child>23</Child>...
|
by: CoolPint |
last post by:
I am trying to write a generic heapsort (of course as a self-exercise)
with Iterator interface: something like blow....
But I got into trouble finding out the Iterator to the Child node. If...
|
by: lawpoop |
last post by:
Hey folks -
Is there an easy way to find child tables for any given table in MySQL
4.1? Right now, I'm running SHOW CREATE TABLE `$table` for all tables,
and then seeing if they have the table...
|
by: Edward Diener |
last post by:
When I try to find out if a trivial event has handlers, by comparing the
event to nullptr, I get compiler error C3918. So my natural question is
how does one test a trivial event for handlers ?
|
by: Manish |
last post by:
This is the print_r() for a variable $categories.
$categories ::
Array
(
=Array
(
=Array
(
| |
by: Allan Ebdrup |
last post by:
I would like to use reflection to find all classes that inherit from my
current class, even if they are in another assembly I want to find them if
the current project has a reference to that...
|
by: skrebbel |
last post by:
Is there any faster/easier way of finding a child node of a certain
DOMNode object than doing something like
function getChildByTagname($curnode, $name)
{
foreach($curnode->childNodes as...
|
by: Tom Gur |
last post by:
Hi,
It's seems that csh and tcsh acts a bit different when handling
special characters in quotes.
i.e: if i'll supply my program with the following arguments: -winpath
"c:\\temp\\"
tcsh will...
|
by: warrior2009 |
last post by:
I have 2 lists (unlinked and unrelated), where one can be called the parent and the other the child with one to many relationship between parent-child. The child table is really big, over a million...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |