vmolsa / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

properties '_last_proc_cpu_times' and '_last_sys_cpu_times' always return null #472

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Call psutil.get_process_list() or process_iter()

Several values including '_last_proc_cpu_times' and '_last_sys_cpu_times' are 
retrieved. However these are always null for every process. Tested on two Linux 
machines and one Windows. 

What version of psutil are you using? What Python version?
Python 2.7.5, psutil 1.2.1. 

On what operating system? Is it 32bit or 64bit version?
64 bit Linux (Ubuntu) and 64 bit Windows 7 

I guess either the properties should be removed if they never generate any 
useful value or something in the code is broken. 

Original issue reported on code.google.com by d...@oversig.ht on 7 Feb 2014 at 2:20

GoogleCodeExporter commented 9 years ago
'_last_proc_cpu_times' and '_last_sys_cpu_times' are null once you instantiate 
a new Process.
They get filled when you call get_cpu_times() or get_cpu_percent().
Basically psutil avoids to unnecessarily fill them in case you DON'T want to 
query process CPU stats.
I'm not sure why you think this is a bug with psutil.
Also you're not supposed to access them in the first place being them private 
attributes.

Original comment by g.rodola on 7 Feb 2014 at 3:46

GoogleCodeExporter commented 9 years ago
Thank you for the information. I suppose the issue can be closed.

Original comment by d...@oversig.ht on 10 Feb 2014 at 9:27

GoogleCodeExporter commented 9 years ago

Original comment by g.rodola on 10 Feb 2014 at 4:18