| 1 |
< |
Load stats a way of pulling out the load average of a system. On most systems, its |
| 2 |
< |
just a wrapper to getloadavg. |
| 1 |
> |
Load Averages |
| 2 |
> |
============= |
| 3 |
|
|
| 4 |
< |
The call returns a static buffer of load_stat_t load_stat |
| 4 |
> |
$Id$ |
| 5 |
|
|
| 6 |
< |
load_stat_t is made up : |
| 6 |
> |
Data Structure |
| 7 |
> |
-------------- |
| 8 |
|
|
| 9 |
+ |
The structure returned is of type load_stat_t and looks like this: |
| 10 |
+ |
|
| 11 |
|
typedef struct{ |
| 12 |
|
double min1; |
| 13 |
|
double min5; |
| 14 |
|
double min15; |
| 15 |
|
}load_stat_t; |
| 16 |
|
|
| 17 |
< |
minX contains a double of the load average over the time X in minutes. |
| 17 |
> |
min1 The load average over 1 minute. |
| 18 |
> |
min5 The load average over 5 minutes. |
| 19 |
> |
min15 The load average over 15 minutes. |
| 20 |
> |
|
| 21 |
> |
Functions |
| 22 |
> |
--------- |
| 23 |
> |
|
| 24 |
> |
load_stat_t *get_load_stats(); |
| 25 |
> |
|
| 26 |
> |
This call returns a static buffer of load_stat_t. |
| 27 |
> |
|
| 28 |
> |
On most systems this function is just a wrapper to the getloadavg |
| 29 |
> |
system call. |
| 30 |
> |
|
| 31 |
> |
Example |
| 32 |
> |
------- |
| 33 |
> |
|
| 34 |
> |
An example can be found in examples/load_stats.c |