Fixed bug in realmem option
This commit is contained in:
parent
c082952423
commit
455466fb67
1 changed files with 3 additions and 1 deletions
4
smem
4
smem
|
|
@ -178,7 +178,9 @@ def fromunits(x):
|
||||||
M=2**20, MB=2**20, G=2**30, GB=2**30)
|
M=2**20, MB=2**20, G=2**30, GB=2**30)
|
||||||
for k,v in s.items():
|
for k,v in s.items():
|
||||||
if x.endswith(k):
|
if x.endswith(k):
|
||||||
return int(float(x[:len(k)])*v)
|
return int(float(x[:-len(k)])*v)
|
||||||
|
sys.stderr.write("Memory size should be written with units, for example 1024M\n")
|
||||||
|
sys.exit(-1)
|
||||||
|
|
||||||
def pidusername(pid):
|
def pidusername(pid):
|
||||||
return src.username(src.piduser(pid))
|
return src.username(src.piduser(pid))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue