[PATCH] run-test: '--time' option provide more details to user

Gregory Szorc gregory.szorc at gmail.com
Tue May 27 12:11:23 CDT 2014


On 5/26/14, 3:01 PM, Anurag Goel wrote:
> On Tue, May 27, 2014 at 12:33 AM, Gregory Szorc <gregory.szorc at gmail.com
> <mailto:gregory.szorc at gmail.com>> wrote:
>
>     On 5/24/2014 12:10 PM, Anurag Goel wrote:
>      > # HG changeset patch
>      > # User anuraggoel <anurag.dsps at gmail.com
>     <mailto:anurag.dsps at gmail.com>>
>      > # Date 1400958116 -19800
>      > #      Sun May 25 00:31:56 2014 +0530
>      > # Node ID 0c6ee6403d787f8eb08fe01550f2e9e0aa637c26
>      > # Parent  883e268cb860c0ea2eb0faa94114e11c3a4a3893
>      > run-test: '--time' option provide more details to user
>      >
>      > 'time.time()' module can only be used to calculate 'real' time
>     taken by a
>      > process. Therefore, I switched it to 'os.times()' module which
>     helps in
>      > getting additional info like "Total number of CPU-seconds that
>     the process
>      > spent in kernel mode" and "Total number of CPU-seconds that the
>     process spent
>      > in user mode".
>
>
>   Could you suggest me some alternate way to add  above mentioned features?

For Windows, I /think/ you are out of luck. AFAIK Windows doesn't have 
an API that counts subprocess times (like getrusage()). It does have 
GetProcessTimes(), but that's only for a single process. There are also 
performance counters for CPU usage, but those are system wide.

I think some information is better than no information. I think 
supplementing the wall time output with os.times() on platforms where 
those values are recorded would be beneficial.


More information about the Mercurial-devel mailing list