The default version uses the rstat call to get information.  The
format of the rstat call is:

rstat(host, stats)

where host is a string, and stats is a pointer to a statstime structure.

Probably the easiest way to port to a new system that lacks rstat
would be to a new version of rstat.  In this file, I try to document
the members of the statstime structure, and how the program uses
the information.  Note that gathering of this information takes
place in the porting.c file.

After that information is gathered (via rstat), it is then processed.
Since rstat reports the total number of events since the system started
up, the number of events since the last time we updated the graph
is the value just returned minus the value that was returned last.
This is why there are two statstime structures in porting.c.  A variable
(new_stat) is used to keep track of which structure the new information
will be loaded into.

This data is then put into the points[][] array. Values should never
be less than zero.  The values are integers.  CPU time being used
should range from 0 to 100.  Number of disk transfers can be anything
above zero.

XSysStats averages most information per second.  This means that if the
update time is every 5 seconds, the number of events since the last
graph will be divided by 5 before.

STATSTIME STRUCTURE:

stats.cp_time[0]	user time
stats.cp_time[1]	nice time
stats.cp_time[2]	system time
stats.cp_time[3]	idle time

these are cumulative totals.  To find the percentage any one of
these is using, first find the difference between the new value
and the old value.  Then, sum them all up.  The percentage any one of
them is using since the last request is the element divided by
the total.  XStatsTime uses the idle time (cp_time[3]) to determine
the amount being utilized.  Let delta[0-3] represent the difference
since the last update of the values above.  This means that for
XSysStat, the percent of cpu being used is 100 - 100*k[3]/(sum(k[0-3]).



stats.avenrun[0]	Divide value by 256 and this is the load
stats.avenrun[1]	average over the last 1,5, and 15 minutes.
stats.avenrun[2]

stats.v_swtch		total context switches

stats.if_collisions	ethernet activity - cumulative totals.
stats.if_oerrors	XSysStat uses the ierrors and ipackets
stats.if_opackets	elements. it might be better to sum
stats.if_ierrors	ipackets+opackets and ierrors+oerrors for
stats.if_ipackets	reporting.

stats.v_pgpgin		page paged in/out, swap paged in/out cumulative totals
stats.v_pgpgout		XSysStat uses the pgpgin and pswpin elements.
stats.v_pswpin		XSysStat does not average these over times.  IT will
stats.v_pswpout		instead plot the total number of occurances of these
			since the last update.  Since these are usually
			fairly low occuring events, I prefered it this way.

stats.v_intr		cumulative # of interrupts.  Although it
			probably should no happen, at times a more
			recently reported value is less than the
			previous reported value.

stats.dk_xfer[0]	disk transfers.  Only the first seems to have
stats.dk_xfer[1]	any real useful (nonzero) value?  If these are
stats.dk_xfer[2]	similiar to what vmstat reports, these can
stats.dk_xfer[3]	be for different disks.

