WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit 534ab569 authored by John Zhang's avatar John Zhang
Browse files

use getrusage(RUSAGE_CHILDREN) to get a more accurate measurement of t_proc

parent ae2c3c96
......@@ -63,12 +63,19 @@ class Language:
def run_in_subproc(cls, cmd, env=None): # TODO: maybe put this in util.py
cmd = list(map(str, cmd))
logger.info(" ".join(cmd))
t0 = time.perf_counter()
import resource
ru0 = resource.getrusage(resource.RUSAGE_CHILDREN)
t0 = ru0.ru_utime + ru0.ru_stime
res = subproc.Popen(cmd, stdout=subproc.PIPE, stderr=subproc.PIPE,
env=env)
so, se = res.communicate()
res = SimpleNamespace(stdout=so, stderr=se, returncode=res.returncode)
t1 = time.perf_counter()
ru1 = resource.getrusage(resource.RUSAGE_CHILDREN)
t1 = ru1.ru_utime + ru1.ru_stime
if res.returncode != 0:
raise ExecutionFailure(cmd, res)
return res, (t1 - t0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment