Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: third_party/psutil/docs/index.html

Issue 6246123: Moving psutil to third_party. This is first step for Media Performance test project. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: modification based on code review's comments Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/psutil/docs/documentation.html ('k') | third_party/psutil/docs/milestones.lnk.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2
3
4 <html>
5 <head>
6 <title>psutil</title>
7 </head>
8 <body>
9
10
11
12
13 <div id="wikicontent">
14 <table width="100%" border="0" cellspacing="0" cellpadding="0">
15 <tr>
16
17 <td class="vt" id="wikimaincol" width="100%">
18
19 <div id="wikiheader" style="margin-bottom:1em">
20
21
22 </div>
23 <h1><a name="Summary"></a>Summary<a href="#Summary" class="section_anchor"></a> </h1><p>psutil is a module providing an interface for retrieving information on running processes and system utilization (CPU, memory) in a portable way by usin g Python, implementing many functionalities offered by command line tools like < strong>ps</strong>, <strong>top</strong>, <strong>kill</strong> and Windows <str ong>task manager</strong>. </p><p>It currently supports <strong>Linux</strong>, <strong>OS X</strong>, <strong>FreeBSD</strong> and <strong>Windows</strong> wit h Python versions from <strong>2.4</strong> to <strong>3.1</strong> by using a u nique code base. </p><h1><a name="Example_usage"></a>Example usage<a href="#Exam ple_usage" class="section_anchor"></a></h1><h3><a name="process_management"></a> process management<a href="#process_management" class="section_anchor"></a></h3> <pre class="prettyprint">&gt;&gt;&gt; import psutil
24 &gt;&gt;&gt; psutil.get_pid_list()
25 [1, 2, 3, 4, 5, 6, 7, 46, 48, 50, 51, 178, 182, 222, 223, 224,
26 268, 1215, 1216, 1220, 1221, 1243, 1244, 1301, 1601, 2237, 2355,
27 2637, 2774, 3932, 4176, 4177, 4185, 4187, 4189, 4225, 4243, 4245,
28 4263, 4282, 4306, 4311, 4312, 4313, 4314, 4337, 4339, 4357, 4358,
29 4363, 4383, 4395, 4408, 4433, 4443, 4445, 4446, 5167, 5234, 5235,
30 5252, 5318, 5424, 5644, 6987, 7054, 7055, 7071]
31 &gt;&gt;&gt; p = psutil.Process(7055)
32 &gt;&gt;&gt; p.name
33 &#x27;python&#x27;
34 &gt;&gt;&gt; p.path
35 &#x27;/usr/bin&#x27;
36 &gt;&gt;&gt; p.cmdline
37 [&#x27;/usr/bin/python&#x27;, &#x27;-O&#x27;, &#x27;run.py&#x27;]
38 &gt;&gt;&gt; p.uid
39 1000
40 &gt;&gt;&gt; p.gid
41 1000
42 &gt;&gt;&gt; p.username
43 &#x27;jake&#x27;
44 &gt;&gt;&gt; p.create_time
45 1267551141.5019531
46 &gt;&gt;&gt; p.get_cpu_percent()
47 12.31243
48 &gt;&gt;&gt; p.get_memory_percent()
49 0.63423
50 &gt;&gt;&gt; rss, vms = p.get_memory_info()
51 &gt;&gt;&gt; &quot;Resident memory: %s KB&quot; %(rss / 1024)
52 &#x27;Resident memory: 3768 KB&#x27;
53 &gt;&gt;&gt; &quot;Virtual memory: %s KB&quot; %(vms / 1024)
54 &#x27;Virtual memory: 6176 KB&#x27;
55 &gt;&gt;&gt;
56 &gt;&gt;&gt; p.suspend()
57 &gt;&gt;&gt; p.resume()
58 &gt;&gt;&gt; psutil.test()
59 UID PID %CPU %MEM VSZ RSS START TIME COMMAND
60 0 0 0.0 0.0 0 0 00:12 00:00 [sched]
61 0 1 0.0 0.3 1740 600 00:12 00:04 /sbin/init
62 0 2 0.0 0.0 0 0 00:12 00:00 [kthreadd]
63 0 3 0.0 0.0 0 0 00:12 00:00 [migration/0]
64 ...
65 0 13239 0.0 2.6 13604 1044 00:38 00:00 /usr/sbin/smbd -D
66 1000 23648 0.0 2.4 12512 2008 14:43 00:06 sshd: user@pts/2
67 1000 23649 0.0 1.2 5944 3340 14:43 00:00 -bash
68 0 25926 0.0 1.1 5432 3072 17:55 00:00 -su
69 0 28655 0.0 1.0 4932 3204 21:58 00:00 python _psutil.py
70 &gt;&gt;&gt;</pre><h3><a name="System_monitoring_(CPU_and_memory)"></a>System mo nitoring (CPU and memory)<a href="#System_monitoring_(CPU_and_memory)" class="se ction_anchor"></a></h3><pre class="prettyprint">&gt;&gt;&gt; import psutil, time
71 &gt;&gt;&gt; print psutil.cpu_times()
72 softirq=50.87; iowait=39.63; system=1130.67; idle=164171.41; user=965.15; irq=7. 08; nice=0.0
73 &gt;&gt;&gt;
74 &gt;&gt;&gt; while 1:
75 ... print round(psutil.cpu_percent(), 1)
76 ... time.sleep(1)
77 ...
78 5.4
79 3.2
80 7.3
81 7.1
82 2.5
83 Traceback (most recent call last):
84 File &quot;&lt;stdin&gt;&quot;, line 3, in &lt;module&gt;
85 KeyboardInterrupt
86 &gt;&gt;&gt;
87 &gt;&gt;&gt; psutil.TOTAL_PHYMEM
88 526458880
89 &gt;&gt;&gt; psutil.avail_phymem()
90 153530368
91 &gt;&gt;&gt; psutil.total_virtmem()
92 197365760
93 &gt;&gt;&gt; psutil.avail_virtmem()
94 194277376</pre><h1><a name="Mailing_lists"></a>Mailing lists<a href="#Mailing_li sts" class="section_anchor"></a></h1><p><strong>Users</strong><br><a href="http: //groups.google.com/group/psutil/topics" rel="nofollow">http://groups.google.com /group/psutil/topics</a> </p><p><strong>Developers</strong><br><a href="http://g roups.google.com/group/psutil-dev/topics" rel="nofollow">http://groups.google.co m/group/psutil-dev/topics</a> </p><p><strong>SVN commits and issue tracker chang es</strong><br><a href="http://groups.google.com/group/psutil-commits/topics" re l="nofollow">http://groups.google.com/group/psutil-commits/topics</a> </p><h1><a name="Contribute"></a>Contribute<a href="#Contribute" class="section_anchor"></ a></h1><p>If you want to help or just give us suggestions about the project and other related things, subscribe to the <a href="http://groups.google.com/group/ psutil" rel="nofollow">discussion mailing list</a>. If you want to talk with pro ject team members about psutil and other related things feel free to contact us at the following addresses: </p><p><table><tr><td style="border: 1px solid #aaa; padding: 5px;"> <strong>Name</strong> </td><td style="border: 1px solid #aaa; p adding: 5px;"> <strong>Country</strong> </td><td style="border: 1px solid #aaa; padding: 5px;"> <strong>E-mail</strong> </td></tr> <tr><td style="border: 1px so lid #aaa; padding: 5px;"> Jay Loden </td><td style="border: 1px solid #aaa; padd ing: 5px;"> New Jersey (USA) </td><td style="border: 1px solid #aaa; padding: 5p x;"> jloden at gmail dot com </td></tr> <tr><td style="border: 1px solid #aaa; padding: 5px;"> Giampaolo Rodola&#x27; </td><td style="border: 1px solid #aaa; p adding: 5px;"> Turin (Italy) </td><td style="border: 1px solid #aaa; padding: 5p x;"> g.rodola at gmail dot com </td></tr> </table></p><p>Feedbacks and suggestio ns are greatly appreciated as well as new testers and coders willing to join the development.<br> For any bug report, patch proposal or feature request, add an entry into the <a href="http://code.google.com/p/psutil/issues/list" rel="nofoll ow">Issue Tracker</a>.<br> </p><p>Thank you. </p>
95
96
97 </body>
98 </html>
99
OLDNEW
« no previous file with comments | « third_party/psutil/docs/documentation.html ('k') | third_party/psutil/docs/milestones.lnk.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698