--- projects/libstatgrab/docs/sg_get_disk_io_stats.xml 2004/05/02 09:35:15 1.6 +++ projects/libstatgrab/docs/sg_get_disk_io_stats.xml 2004/05/02 17:21:35 1.7 @@ -3,51 +3,51 @@ - + - $Date: 2004/05/02 09:35:15 $ - $Id: sg_get_disk_io_stats.xml,v 1.6 2004/05/02 09:35:15 tdb Exp $ + $Date: 2004/05/02 17:21:35 $ + $Id: sg_get_disk_io_stats.xml,v 1.7 2004/05/02 17:21:35 tdb Exp $ - + - get_diskio_stats + sg_get_disk_io_stats 3 i-scream - + - get_diskio_stats - get_diskio_stats_diff + sg_get_disk_io_stats + sg_get_disk_io_stats_diff get disk io statistics - + #include <statgrab.h> - diskio_stat_t *get_diskio_stats + sg_disk_io_stats *sg_get_disk_io_stats int *entries - diskio_stat_t *get_diskio_stats_diff + sg_disk_io_stats *sg_get_disk_io_stats_diff int *entries - + Description Both calls take a pointer to an int, entries, which is filled with the number of disks the machine has. This is needed to know how many - diskio_stat_t structures have been + sg_disk_io_stats structures have been returned. A pointer is returned to the first - diskio_stat_t. + sg_disk_io_stats. - get_diskio_stats returns the disk IO stored + sg_get_disk_io_stats returns the disk IO stored in the kernel which holds the amount of data transferred since bootup. On some platforms, such as Solaris 7, this value is stored in a 32bit int, so wraps around when it reaches 4GB. Other @@ -55,10 +55,10 @@ which wraps somewhere near 17 million terabytes. - get_diskio_stats_diff is the same as - get_diskio_stats except it will return the + sg_get_disk_io_stats_diff is the same as + sg_get_disk_io_stats except it will return the difference since the last call. So, for instance a call to - get_diskio_stats_diff is made, and called + sg_get_disk_io_stats_diff is made, and called again 5 seconds later. Over that time, 2000 bytes of traffic were written and 10000 bytes read. write_bytes will store 2000 bytes, read_bytes will @@ -75,13 +75,13 @@ statgrab_init is called. - + Return Values All diskio statistics return a pointer to a structure of type - diskio_stat_t. + sg_disk_io_stats. @@ -90,7 +90,7 @@ typedef struct{ long long read_bytes; long long write_bytes; time_t systime; -}diskio_stat_t; +}sg_disk_io_stats; @@ -132,7 +132,7 @@ typedef struct{ The time period over which read_bytes - and write_bytes were transferred. + and write_bytes were transferred. @@ -142,15 +142,15 @@ typedef struct{ Bugs - On the very first call get_diskio_stats_diff - will return the same as get_diskio_stats. + On the very first call sg_get_disk_io_stats_diff + will return the same as sg_get_disk_io_stats. After the first call it will always return the difference. On operating systems that hold only 32bits of data there is a problem if the values wrap twice. For example, on Solaris 7 if 9GB is transferred and the operating system wraps at 4GB, the - get_diskio_stats_diff function will return + sg_get_disk_io_stats_diff function will return 5GB. @@ -167,10 +167,10 @@ typedef struct{ - + Website - +