beostat_get_loadavg

Name

beostat_get_loadavg -- get load average on a node

Synopsis

#include <sys/beostat.h>

int beostat_get_loadavg (int node, struct beostat_loadavg *loadavg);

Arguments

node

The node to query

loadavg

A pointer to a struct beostat_loadavg, which is defined as follows:

 struct beostat_loadavg
 {
   float load[3];
   int num_active_procs;
   int total_procs;
   int last_pid;
 };

Description

beostat_get_loadavg will get the load average information of a node in the cluster. The three values given averages over increasing time durations.

Examples

 struct beostat_loadavg loadavg;
 beostat_get_loadavg (3, &loadavg);
 printf ("The load process ID on node 3 was %d.\n", loadavg.last_pid);

Return Value

Return 0 on success. If an error occurs, it will return -1.

Errors

This function relies on the Beostat subsystem, which consists of the proc filesystem on the remote node, the sendstats daemon on the remote node, the recvstats daemon on the master node, and two shared memory files in the directory /var/shm. If any part of the system breaks down, this function could fail.