ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/docs/sg_get_cpu_stats.xml
(Generate patch)

Comparing projects/libstatgrab/docs/sg_get_cpu_stats.xml (file contents):
Revision 1.2 by tdb, Thu Oct 2 17:38:03 2003 UTC vs.
Revision 1.6 by tdb, Sun May 2 17:39:19 2004 UTC

# Line 3 | Line 3
3   <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4                 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5  
6 < <refentry id="cpu_percent_usage">
6 > <refentry id="sg_get_cpu_stats">
7  
8    <refentryinfo>
9      <date>$Date$</date>
10      <releaseinfo>$Id$</releaseinfo>
11    </refentryinfo>
12 <  
12 >
13    <refmeta>
14 <    <refentrytitle>cpu_percent_usage</refentrytitle>
14 >    <refentrytitle>sg_get_cpu_stats</refentrytitle>
15      <manvolnum>3</manvolnum>
16      <refmiscinfo>i-scream</refmiscinfo>
17    </refmeta>
18 <  
18 >
19    <refnamediv>
20 <    <refname>cpu_percent_usage</refname>
21 <    <refname>get_cpu_totals</refname>
22 <    <refname>get_cpu_diff</refname>
20 >    <refname>sg_get_cpu_stats</refname>
21 >    <refname>sg_get_cpu_stats_diff</refname>
22 >    <refname>sg_get_cpu_percents</refname>
23      <refpurpose>get cpu usage</refpurpose>
24    </refnamediv>
25 <    
25 >
26    <refsynopsisdiv>
27      <funcsynopsis>
28        <funcsynopsisinfo>#include &lt;statgrab.h&gt;</funcsynopsisinfo>
29        <funcprototype>
30 <        <funcdef>cpu_percent_t *<function>cpu_percent_usage</function></funcdef>
30 >        <funcdef>sg_cpu_percents *<function>sg_get_cpu_percents</function></funcdef>
31          <void/>
32        </funcprototype>
33        <funcprototype>
34 <        <funcdef>cpu_states_t *<function>get_cpu_totals</function></funcdef>
34 >        <funcdef>sg_cpu_stats *<function>sg_get_cpu_stats</function></funcdef>
35          <void/>
36        </funcprototype>
37        <funcprototype>
38 <        <funcdef>cpu_states_t *<function>get_cpu_diff</function></funcdef>
38 >        <funcdef>sg_cpu_stats *<function>sg_get_cpu_stats_diff</function></funcdef>
39          <void/>
40        </funcprototype>
41      </funcsynopsis>
42    </refsynopsisdiv>
43 <    
43 >
44    <refsect1>
45      <title>Description</title>
46      <para>
47 <      <function>get_cpu_totals()</function> and
48 <      <function>get_cpu_diff()</function> both return static pointers
49 <      of type <structname>cpu_states_t</structname>.
50 <      <function>get_cpu_totals()</function> returns the total amount of
47 >      <function>sg_get_cpu_stats()</function> and
48 >      <function>sg_get_cpu_stats_diff()</function> both return static pointers
49 >      of type <structname>sg_cpu_stats</structname>.
50 >      <function>sg_get_cpu_stats()</function> returns the total amount of
51        "ticks" the operating system has spent in each of the different
52 <      states. <function>get_cpu_diff()</function> returns the
52 >      states. <function>sg_get_cpu_stats_diff()</function> returns the
53        difference in "ticks" for each of the states since last time
54 <      <function>get_cpu_diff()</function> or
55 <      <function>get_cpu_totals()</function> was called. If it has never
54 >      <function>sg_get_cpu_stats_diff()</function> or
55 >      <function>sg_get_cpu_stats()</function> was called. If it has never
56        been called, it will return the result of
57 <      <function>get_cpu_totals()</function>.
57 >      <function>sg_get_cpu_stats()</function>.
58      </para>
59      <para>
60        The value stored (the "ticks") will vary between operating
# Line 68 | Line 68
68        against the total, or in percentages.
69      </para>
70      <para>
71 <      <function>cpu_percent_usage()</function> returns a pointer to a
72 <      static <structname>cpu_percent_t</structname>.  The function
73 <      calls <function>get_cpu_diff()</function> and changes the values
71 >      <function>sg_get_cpu_percents()</function> returns a pointer to a
72 >      static <structname>sg_cpu_percents</structname>.  The function
73 >      calls <function>sg_get_cpu_stats_diff()</function> and changes the values
74        into percentages. If it has never been called before (and nor has
75 <      <function>get_cpu_totals()</function> or
76 <      <function>get_cpu_diff()</function>), the returned percentages
75 >      <function>sg_get_cpu_stats()</function> or
76 >      <function>sg_get_cpu_stats_diff()</function>), the returned percentages
77        will be the systems total ever since its uptime. (Unless the
78        counters have cycled)
79      </para>
80    </refsect1>
81 <  
81 >
82    <refsect1>
83      <title>Return Values</title>
84  
# Line 97 | Line 97 | typedef struct{
97          long long nice;
98          long long total;
99          time_t systime;
100 < }cpu_states_t;
100 > }sg_cpu_stats;
101      </programlisting>
102  
103      <programlisting>
# Line 109 | Line 109 | typedef struct{
109          float swap;
110          float nice;
111          time_t time_taken;
112 < }cpu_percent_t;
112 > }sg_cpu_percents;
113      </programlisting>
114  
115      <variablelist>
# Line 155 | Line 155 | typedef struct{
155        </member>
156      </simplelist>
157    </refsect1>
158 <  
158 >
159    <refsect1>
160      <title>Website</title>
161 <    
161 >
162      <simplelist type="vert">
163        <member>
164 <        <ulink url="http://www.i-scream.org">http://www.i-scream.org</ulink>
164 >        <ulink url="http://www.i-scream.org/libstatgrab/">
165 >          http://www.i-scream.org/libstatgrab/
166 >        </ulink>
167        </member>
168      </simplelist>
169    </refsect1>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines