add dir_stat.disk_usage

This commit is contained in:
Doug MacEachern 2005-12-14 01:28:44 +00:00
parent 26f4aa8cbb
commit ab3abd5119
4 changed files with 7 additions and 0 deletions

View File

@ -586,6 +586,9 @@ my %classes = (
{
name => 'sockets', type => 'Long',
},
{
name => 'disk_usage', type => 'Long',
},
],
NetInfo => [
{

View File

@ -51,6 +51,7 @@ public class Watch {
System.out.println(" Blkdevs....." + stats.getBlkdevs());
System.out.println(" Sockets....." + stats.getSockets());
System.out.println(" Total......." + stats.getTotal());
System.out.println(" Disk Usage.." + stats.getDiskUsage());
}
}

View File

@ -110,6 +110,7 @@ typedef struct {
sigar_uint64_t chrdevs;
sigar_uint64_t blkdevs;
sigar_uint64_t sockets;
sigar_uint64_t disk_usage;
} sigar_dir_stat_t;
SIGAR_DECLARE(const char *)

View File

@ -634,6 +634,8 @@ int sigar_dir_stat_get(sigar_t *sigar,
continue;
}
dirstats->disk_usage += info.st_size;
switch (filetype_from_mode(info.st_mode)) {
case SIGAR_FILETYPE_REG:
++dirstats->files;