add dir_stat.disk_usage
This commit is contained in:
parent
26f4aa8cbb
commit
ab3abd5119
|
@ -586,6 +586,9 @@ my %classes = (
|
|||
{
|
||||
name => 'sockets', type => 'Long',
|
||||
},
|
||||
{
|
||||
name => 'disk_usage', type => 'Long',
|
||||
},
|
||||
],
|
||||
NetInfo => [
|
||||
{
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 *)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue