Added total disk IO metric

This commit is contained in:
nettag 2013-08-04 16:19:41 +03:00
parent b13b8dcbbb
commit 0d91f7d6a4
4 changed files with 11 additions and 3 deletions

View File

@ -637,6 +637,11 @@ use vars qw(%classes %cmds);
name => 'bytes_written', type => 'Long', name => 'bytes_written', type => 'Long',
desc => 'Bytes Written', desc => 'Bytes Written',
plat => 'LW' plat => 'LW'
},
{
name => 'bytes_total', type => 'Long',
desc => 'Bytes Total',
plat => 'LW'
} }
], ],
ProcState => [ ProcState => [

View File

@ -295,7 +295,8 @@ SIGAR_DECLARE(int) sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid,
typedef struct { typedef struct {
sigar_uint64_t sigar_uint64_t
bytes_read, bytes_read,
bytes_written; bytes_written,
bytes_total;
} sigar_proc_disk_io_t; } sigar_proc_disk_io_t;
SIGAR_DECLARE(int) sigar_proc_disk_io_get(sigar_t *sigar, sigar_pid_t pid, SIGAR_DECLARE(int) sigar_proc_disk_io_get(sigar_t *sigar, sigar_pid_t pid,

View File

@ -791,6 +791,7 @@ int sigar_proc_disk_io_get(sigar_t *sigar, sigar_pid_t pid,
proc_disk_io->bytes_read = get_named_proc_token(buffer, "\nread_bytes"); proc_disk_io->bytes_read = get_named_proc_token(buffer, "\nread_bytes");
proc_disk_io->bytes_written = get_named_proc_token(buffer, "\nwrite_bytes"); proc_disk_io->bytes_written = get_named_proc_token(buffer, "\nwrite_bytes");
proc_disk_io->bytes_total = proc_disk_io->bytes_read + proc_disk_io->bytes_written;
return SIGAR_OK; return SIGAR_OK;
} }

View File

@ -1224,8 +1224,9 @@ SIGAR_DECLARE(int) sigar_proc_disk_io_get(sigar_t *sigar, sigar_pid_t pid,
return status; return status;
} }
proc_disk_io->bytes_read = pinfo->bytes_read; proc_disk_io->bytes_read = pinfo->bytes_read;
proc_disk_io->bytes_written = pinfo->bytes_written; proc_disk_io->bytes_written = pinfo->bytes_written;
proc_disk_io->bytes_total = proc_disk_io->bytes_read + proc_disk_io->bytes_written;
return SIGAR_OK; return SIGAR_OK;
} }