sopel39 0 Newbie Poster

Hi

My problem is that i need to measure given command statistics (time, mem, etc) with shell script
My script must basically do two things:
1. Measure overall command statistics (it is total time, maximum memory use during runtime, etc)
2. Measure command statistics in given periods of time during it's run (once a x seconds)
Then i have few questions:
1. what is the best method for checking command statistics during runtime (for example ps returns process time in seconds, but i need better resolution (are jeffes realible))
2. How to make gathering data during run and after that possible. my idea is that i test given command overall statistics with time command, and use some other command to test statistics during its runtime, but...
how to detect that command finished?
let's say that i use time for overall statistics, i have to do something like that
[time given_command...] &
part_of_script_testing_given_command_during_runtime
how to get pid of [time given_command...] in the main script?

and if you know some examples of such script, can you give some links?

if you know please help thx
Charles

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.