Tidy up of lots of little things. :)
Ported to work onto freebsd.
Removed getting of some data we didn't really need or use. Updated page_stats to work with linux. Fixed tools.h to compile nicely :)
Added linux support for cpu stats
Made cpu stats to a type a bit more cross platform :)
changed user_stats to return something more useful for ihost, and prob something more useful to everyone else too. Although, they can't just itterate thru it now, they got to find ' ' :)
Changed function name changed to be consistent.
Added a diff diskio_stats and fixed a bug. This is the last thing needed for the solaris version of the new libstatgrab, bar bug fixes.
Added support for read/write stats on a per disk basis. This does not count metadisks as disks. I will also add io transfer for mounted devices, and the ususal diff() function that gives you the differences since last time you called it.
network stats now returns a diff() style function, to make it easy to show the exact average network traffic over a period of time.
Added get_page_stats_diff() which returns the number of pages in/out etc since last time it was called, and the time difference since last time it was called. This makes it very easy for a host to know how many pages averaged over a period of time.
Finished page stats. It returns 2 things. One, number of pages swapped in and out, 2, the number of pageins and pageouts. As to if this is actually correct or not, im not 100% sure, but tests seem to imply it is. from: http://www.sun.com/sun-on-net/itworld/UIR960901perf.html ulong pgin; /* pageins */ ulong pgpgin; /* pages paged in */ ulong pgout; /* pageouts */ ulong pgpgout; /* pages paged out */ ulong swapin; /* swapins */ ulong pgswapin; /* pages swapped in */ ulong swapout; /* swapouts I am *not* using swapins and swapouts. I did this in the orginal libstatgrab, and it didn't work. Looking at it more closely, it always seems to have 0 in it, so my guess is its broke. :)
The new revesion of libstatgrab, which is a complete rewrite essentially. Firstly the data is now returned in structures rather than xml strings. The structures returned are all static, so what ever calls the library doesn't have to deal with the memory management of it. Secondly the general efficency of the code is now significantly faster. It no longer needs to fork a process, connect file descriptors and run ps, and then parse the output like it used to. Now it walks /proc and reads it into the correct data structures. This works without needing any special privilages, so it can still run as a normal mortal without needing any special group. (Freebsd will be an exception to this, but this commit only works with solaris, and that requires nothing special) Thridly it has more functionality than it used to. It not for instance is capable of showing network traffic stats, (although its not completely finished yet). It also in the near future be able to disk io stats as well. Several bug fixes have been aplied over the original version. For example the cpu_stats used to only reply the stats for the first processor. This now will report the total stats of all of them. Paging stats will also be fixed, but haven't been done yet.
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.