Comment on Documentation in psutil

6 views
Skip to first unread message

psu...@googlecode.com

unread,
Jan 3, 2011, 4:46:41 AM1/3/11
to psutil-...@googlegroups.com
Comment by Bornstub:

The cpu_percent should be get_cpu_percent, it is a typo.

For more information:
http://code.google.com/p/psutil/wiki/Documentation

psu...@googlecode.com

unread,
Jan 3, 2011, 4:58:42 AM1/3/11
to psutil-...@googlegroups.com
Comment by g.rod...@gmail.com:

Fixed, thanks.

psu...@googlecode.com

unread,
Feb 19, 2011, 3:45:22 PM2/19/11
to psutil-...@googlegroups.com
Comment by PomBea...@gmail.com:

In Windows environment, if path to executable is defined in Windows System
Variables and Process is started from command prompt using lets say c:\
module will not return any useful information Back about path of the
executable.

psu...@googlecode.com

unread,
Feb 19, 2011, 3:49:23 PM2/19/11
to psutil-...@googlegroups.com
Comment by PomBea...@gmail.com:

In Windows environment, if path to executable is defined in Windows System

Variables and Process is started from command prompt using different
directory lets say from "c:\" - module will not return any useful

psu...@googlecode.com

unread,
Feb 19, 2011, 4:14:37 PM2/19/11
to psutil-...@googlegroups.com
Comment by g.rod...@gmail.com:

I'm not sure what you mean by "Windows System Variables". If you think this
is a bug with psutil could you please file a bug report providing an
example on how to reproduce the prblem?

psu...@googlecode.com

unread,
Apr 13, 2011, 9:32:59 AM4/13/11
to psutil-...@googlegroups.com
Comment by victor.dramba:

this seems to be a typo: "For total physical memory use psutil.BOOT_TIME
constant."

psu...@googlecode.com

unread,
Apr 13, 2011, 9:37:00 AM4/13/11
to psutil-...@googlegroups.com
Comment by g.rod...@gmail.com:

I'm not a native English speaker but I see no typo in that sentence.

psu...@googlecode.com

unread,
Apr 13, 2011, 10:08:35 AM4/13/11
to psutil-...@googlegroups.com
Comment by jlo...@gmail.com:

I think he meant that we're suggesting total physical memory is in the
BOOT_TIME constant instead of psutil.TOTAL_PHYMEM :)

psu...@googlecode.com

unread,
Dec 27, 2011, 10:31:21 PM12/27/11
to psutil-...@googlegroups.com
Comment by billy020...@gmail.com:

how can we get the list of processName? Understand we can get list of
processID using get_pid_list(), but how about processName.

psu...@googlecode.com

unread,
Dec 27, 2011, 10:41:29 PM12/27/11
to psutil-...@googlegroups.com
Comment by jlo...@gmail.com:

> how can we get the list of processName? Understand we can get list of
> processID using get_pid_list(), but how about processName.

This would be a better question for the mailing list:
http://groups.google.com/group/psutil/

There is no specific function for list of process names, you need to
iterate through the processes to get the process name for each process and
of course catch any exceptions along the way.

psu...@googlecode.com

unread,
Dec 27, 2011, 10:45:33 PM12/27/11
to psutil-...@googlegroups.com

psu...@googlecode.com

unread,
Jan 10, 2012, 1:51:45 AM1/10/12
to psutil-...@googlegroups.com
Comment by prashant...@gmail.com:

I am getting incorrect memory values when I use psutil inside an OpenVZ
container.


>>> psutil.TOTAL_PHYMEM
8343113728L


root@juicermachine:~# free
total used free shared buffers cached
Mem: 3145728 625004 2520724 0 0 0
-/+ buffers/cache: 625004 2520724
Swap: 0 0 0


How can I fix this?

psu...@googlecode.com

unread,
May 20, 2012, 10:39:27 PM5/20/12
to psutil-...@googlegroups.com
Comment by hadisyar...@gmail.com:

my program psutil with vpython, it's to slow, but it's good for showing
graphical with vpython:

import wmi
import psutil
import os
from visual.graph import *
from visual.controls import *


graph1 =gdisplay(x=0,y=0 ,width=200, height=200,
xtitle='Interval', ytitle='Bytes',
foreground=color.green, background=color.black)
label(display=graph1.display, pos=(50000,100000000000), text="Network
Monitoring")
graph1.display.visible = False # make the display invisible

f1 = gcurve(color=color.cyan)
f2 = gcurve(color=color.red)
f3 = gcurve(color=color.blue)
f4 = gcurve(color=color.green)
f55= gcurve(color=color.black)

graph2 = gdisplay(x=0,y=0, width=200, height=200,xtitle='Interval',
ytitle='Percentage',
foreground=color.green, background=color.black)
label(display=graph2.display, pos=(50000,100), text="CPU and Temp
Processor")
graph2.display.visible = False # make the display invisible
f5 = gcurve(color=color.red)
f6 = gcurve(color=color.yellow)

graph3 = gdisplay(x=0,y=0, width=200, height=200,xtitle='Interval',
ytitle='Bytes',
foreground=color.green, background=color.black)
label(display=graph3.display, pos=(50000,100000000000), text="Bytes Memory
Usage")
graph3.display.visible = False # make the display invisible
f7=gcurve(color=color.yellow)
f8=gcurve(color=color.red)

graph4 = gdisplay(x=0,y=0, width=200, height=200,xtitle='Interval',
ytitle='Count',
foreground=color.green, background=color.black)
label(display=graph4.display, pos=(50000,100000000000), text="Read Count")
graph4.display.visible = False # make the display invisible
f9=gcurve(color=color.blue)
f10=gcurve(color=color.orange)

graph5 = gdisplay(x=0,y=0, width=200, height=200,xtitle='Interval',
ytitle='Time',
foreground=color.green, background=color.black)
label(display=graph5.display, pos=(50000,10000000000), text="Read Time")
graph5.display.visible = False # make the display invisible
f11=gcurve(color=color.red)
f12=gcurve(color=color.yellow)

graph6 = gdisplay(x=0,y=0, width=200, height=200,xtitle='Interval',
ytitle='Time',
foreground=color.green, background=color.black)
label(display=graph6.display, pos=(50000,10000000000), text="Read Time")
graph6.display.visible = False # make the display invisible
f13=gcurve(color=color.red)
f14=gcurve(color=color.yellow)
f15=gcurve(color=color.blue)
f16=gcurve(color=color.magenta)
f17=gcurve(color=color.green)

graph7 = gdisplay(x=0,y=0, width=200, height=200,xtitle='Interval',
ytitle='Time',
foreground=color.green, background=color.black)
label(display=graph7.display, pos=(50000,10000000000), text="Read Time")
graph7.display.visible = False # make the display invisible
f18=gcurve(color=color.blue)
f19=gcurve(color=color.orange)
f20=gcurve(color=color.red)
f21=gcurve(color=color.magenta)
f22=gcurve(color=color.green)
f23=gcurve(color=color.cyan)

graph8 = gdisplay(x=0,y=0, width=200, height=200,xtitle='Interval',
ytitle='Time',
foreground=color.green, background=color.black)
label(display=graph8.display, pos=(50000,10000000000), text="Read Time")
graph8.display.visible = False # make the display invisible
f24=gcurve(color=color.yellow)
f25=gcurve(color=color.blue)
f26=gcurve(color=color.red)
f27=gcurve(color=color.orange)

graph9 = gdisplay(x=0,y=0, width=200, height=200,xtitle='Interval',
ytitle='Time',
foreground=color.green, background=color.black)
label(display=graph9.display, pos=(50000,10000000000), text="Read Time")
graph9.display.visible = False # make the display invisible
f28 = gcurve(color=color.cyan)
f29 = gcurve(color=color.red)
f30 = gcurve(color=color.blue)
f31 = gcurve(color=color.green)
f32=gcurve(color=color.yellow)
f33=gcurve(color=color.blue)
f34=gcurve(color=color.red)
f35=gcurve(color=color.orange)
f36 = gcurve(color=color.red)
f37 = gcurve(color=color.yellow)
f38=gcurve(color=color.yellow)
f39=gcurve(color=color.red)
f40=gcurve(color=color.blue)
f41=gcurve(color=color.orange)
f42=gcurve(color=color.red)
f43=gcurve(color=color.yellow)
f44=gcurve(color=color.red)
f45=gcurve(color=color.yellow)
f46=gcurve(color=color.blue)
f47=gcurve(color=color.magenta)
f48=gcurve(color=color.green)
f49=gcurve(color=color.blue)
f50=gcurve(color=color.orange)
f51=gcurve(color=color.red)
f52=gcurve(color=color.magenta)
f53=gcurve(color=color.green)
f54=gcurve(color=color.cyan)


for x in range(100000000):
psutil.test()
e=psutil.network_io_counters()
d=e.bytes_sent
f=e.bytes_recv
g=e.packets_sent
h=e.packets_recv
dd=str(d)
print d
ff=str(f)
print f
gg=str(g)
print g
hh=str(h)
print h
p = psutil.Process(os.getpid())
b = p.get_cpu_percent(interval=1)
w=wmi.WMI(namespace="root\wmi")
temperature_info=w.MSAcpi_ThermalZoneTemperature()[0]
a=(temperature_info.CurrentTemperature/10)-273
i=psutil.disk_io_counters()
j=i.read_count
k=i.write_count
l=i.read_bytes
m=i.write_bytes
n=i.read_time
o=i.write_time
q=psutil.avail_phymem()
r=psutil.used_phymem()
s=psutil.total_virtmem()
t=psutil.avail_virtmem()
u=psutil.used_virtmem()
v=psutil.disk_io_counters(perdisk=False)
z=v.read_count
z1=v.write_count
z2=v.read_bytes
z3=v.write_bytes
z4=v.read_time
z5=v.write_time
z6=psutil.network_io_counters(pernic=False)
z7=z6.bytes_sent
z8=z6.bytes_recv
z9=z6.packets_sent
z10=z6.packets_recv
f1.plot(pos=(x,d))
f54.plot(pos=(x,d))
dd=str(d)
print d
f2.plot(pos=(x,f))
f3.plot(pos=(x,g))
f4.plot(pos=(x,h))
f5.plot(pos=(x,b))
f6.plot(pos=(x,a))
f7.plot(pos=(x,l))
f8.plot(pos=(x,m))
f9.plot(pos=(x,j))
f10.plot(pos=(x,k))
f11.plot(pos=(x,n))
f12.plot(pos=(x,o))
f13.plot(pos=(x,q))
f14.plot(pos=(x,r))
f15.plot(pos=(x,s))
f16.plot(pos=(x,t))
f17.plot(pos=(x,u))
f18.plot(pos=(x,z))
f19.plot(pos=(x,z1))
f20.plot(pos=(x,z2))
f21.plot(pos=(x,z3))
f22.plot(pos=(x,z4))
f23.plot(pos=(x,z5))
f24.plot(pos=(x,z7))
f25.plot(pos=(x,z8))
f26.plot(pos=(x,z9))
f27.plot(pos=(x,z10))
f28.plot(pos=(x,d))
dd=str(d)
print d
f29.plot(pos=(x,f))
f30.plot(pos=(x,g))
f31.plot(pos=(x,h))
f32.plot(pos=(x,b))
f33.plot(pos=(x,a))
f34.plot(pos=(x,l))
f35.plot(pos=(x,m))
f36.plot(pos=(x,j))
f37.plot(pos=(x,k))
f38.plot(pos=(x,n))
f39.plot(pos=(x,o))
f40.plot(pos=(x,q))
f41.plot(pos=(x,r))
f42.plot(pos=(x,s))
f43.plot(pos=(x,t))
f44.plot(pos=(x,u))
f45.plot(pos=(x,z))
f46.plot(pos=(x,z1))
f47.plot(pos=(x,z2))
f48.plot(pos=(x,z3))
f49.plot(pos=(x,z4))
f50.plot(pos=(x,z5))
f51.plot(pos=(x,z7))
f52.plot(pos=(x,z8))
f53.plot(pos=(x,z9))
f54.plot(pos=(x,z10))

psu...@googlecode.com

unread,
May 20, 2012, 10:54:39 PM5/20/12
to psutil-...@googlegroups.com

psu...@googlecode.com

unread,
Jun 8, 2012, 4:40:49 AM6/8/12
to psutil-...@googlegroups.com
Comment by sbalacha...@gmail.com:

Hi,

How to get the CPU percentage of a particular process

psu...@googlecode.com

unread,
Jun 18, 2012, 12:16:25 AM6/18/12
to psutil-...@googlegroups.com
Comment by tommi.va...@conformiq.com:

Process.get_children() is *New in 0.2.0*

psu...@googlecode.com

unread,
Jul 9, 2012, 11:37:52 AM7/9/12
to psutil-...@googlegroups.com
Comment by brightda...@gmail.com:

Is it possible to use psutil directly in C? and if so where do I start from?

psu...@googlecode.com

unread,
Jul 10, 2012, 6:26:53 AM7/10/12
to psutil-...@googlegroups.com
Comment by g.rodola:

No.

psu...@googlecode.com

unread,
Sep 18, 2012, 5:38:13 AM9/18/12
to psutil-...@googlegroups.com
Comment by robert.s...@gmail.com:

The documentation still states that the CPU percentage method is
cpu_percent() but it is get_cpu_percent(). Please fix.

psu...@googlecode.com

unread,
Sep 18, 2012, 11:05:27 AM9/18/12
to psutil-...@googlegroups.com
Comment by jlo...@gmail.com:

Robert, the documentation is correct... there are two functions in psutil,
one for system wide cpu usage which is cpu_percent() and one for individual
process utilization, which is get_cpu_percent()

>>> import psutil

>>> psutil.cpu_percent()
21.100000000000001

>>> psutil.Process(os.getpid()).get_cpu_percent()
0.20000000000000001

psu...@googlecode.com

unread,
Sep 18, 2012, 11:06:32 AM9/18/12
to psutil-...@googlegroups.com

psu...@googlecode.com

unread,
Jan 9, 2013, 1:02:24 PM1/9/13
to psutil-...@googlegroups.com
Comment by richkapp...@gmail.com:

A little help please. Running Ubuntu 12.04, python 2.7 on a 64 bit HP G62.
Installed psutil via apt-get install python-psutil.
Most of it works, but some doesn't, for example, (having imported psutil as
ps)

>>> ps.cpu_percent()
5.0

okay, that bit works fine, but when I try

>>> ps.virtual_memory()

I get an attribute error that says the module object has no
attribute 'virtual_memory'

Is this a version issue? Any idea what I'm doing wrong or missing?

regards, Richard
richk...@gmail.com

psu...@googlecode.com

unread,
Jan 9, 2013, 1:09:55 PM1/9/13
to psutil-...@googlegroups.com
Comment by jlo...@gmail.com:

Rich, that question is better suited to the bug tracker or mailing list
rather than the documentation page.

psu...@googlecode.com

unread,
Jan 9, 2013, 4:05:46 PM1/9/13
to psutil-...@googlegroups.com
Comment by richkapp...@gmail.com:

SURVEY SAYS: It was a version issue. 0.4.1 is the version in the Ubuntu
repository and apparently doesn't contain the virtual_memory function, I
installed 0.6.1 and all is now well.

regards, Richard

psu...@googlecode.com

unread,
Feb 6, 2013, 4:52:36 AM2/6/13
to psutil-...@googlegroups.com
Comment by puneetkh...@gmail.com:

Physical Memory; total=8004 MB; usage=36.5%; used=6610 MB; free=1394 MB
We have logged following in our system using psutil, isn't the memory usage
calculation in percentage wrong here? Or, am I missing something here?

psu...@googlecode.com

unread,
Feb 6, 2013, 10:14:13 AM2/6/13
to psutil-...@googlegroups.com
Comment by jlo...@gmail.com:

Questions are best suited to the mailing list or bug tracker (if a definite
bug is involved) rather than the comments of the documentation page.

psu...@googlecode.com

unread,
May 24, 2013, 6:11:36 AM5/24/13
to psutil-...@googlegroups.com
Comment by ipods...@126.com:

Documentation

Source(s): http://downloadranking.com/support.php

psu...@googlecode.com

unread,
Jun 7, 2013, 3:06:07 AM6/7/13
to psutil-...@googlegroups.com
Comment by hcyao...@gmail.com:

I want know how to get the Multicore cpu percentage of a particular process

For more information:
https://code.google.com/p/psutil/wiki/Documentation

psu...@googlecode.com

unread,
Jun 7, 2013, 3:30:57 AM6/7/13
to psutil-...@googlegroups.com
Comment by g.rodola:

You can't. Next time please use the mailing list.

psu...@googlecode.com

unread,
Nov 21, 2013, 5:37:51 PM11/21/13
to psutil-...@googlegroups.com
Comment by y...@volarvideo.com:

psutil is awesome! I am using it in my project.

Is there a process version of psutil.net_io_counters()?
A process even has the get_io_counters().
I am wondering if there will be a net_io_counters() for a process.

psu...@googlecode.com

unread,
Nov 21, 2013, 5:42:51 PM11/21/13
to psutil-...@googlegroups.com
Comment by g.rodola:

AFAIK most (all?) operating systtems do not expose those metrics so no,
unfortunately this is not possible. I'm not 100% sure though (maybe Linux
might provide the necessary hooks).

psu...@googlecode.com

unread,
Dec 9, 2013, 5:22:06 PM12/9/13
to psutil-...@googlegroups.com
Comment by justany...@gmail.com:

I'm looking for a replacement for calling iostat -d 60 (delay 60 seconds).
Instead, I want to call a library twice, a minute apart, and find all the
stats available from iostat.

psutils provides most of these, but not IO utilization PERCENT, available
from /proc/diskstats. Also, vmstat -a changed to vmstat -s doesn't provide
ioblocksIn / ioBlocksOut; I think I have to get this from diskstats, too.

psu...@googlecode.com

unread,
Dec 9, 2013, 5:24:15 PM12/9/13
to psutil-...@googlegroups.com
Comment by g.rodola:

Please use the ml or your message is likely to get lost (a migration to
github is planned).

psu...@googlecode.com

unread,
Aug 20, 2014, 1:32:02 PM8/20/14
to psutil-...@googlegroups.com
Comment by waglesid...@gmail.com:

I don't see any way to determine processor speed. Is there a way to get cpu
speeds?

psu...@googlecode.com

unread,
Oct 24, 2014, 3:44:51 AM10/24/14
to psutil-...@googlegroups.com
Comment by nadeem.r...@gmail.com:

a parallel application's cpu utillization is quite rideculas e.g.(1000.0%,
1200.0%)
I have 8 cores maximum it should be max 800.0% if application is running on
all 8 cores should not be above 800.0%.
any reasonable answers.

psu...@googlecode.com

unread,
Oct 24, 2014, 4:37:10 AM10/24/14
to psutil-...@googlegroups.com
Comment by g.rodola:

This is not the right place for asking these kind of questions (use the
ml). Also the project has been moved to github long ago. Also, you should
provide more info about your problem (but not here).
Reply all
Reply to author
Forward
0 new messages