[pve-devel] [PATCH 1/2] add diskread, diskwrite, netin, netout to ResourceStore grid stats
Alexandre Derumier
aderumier at odiso.com
Thu Jul 5 13:24:03 CEST 2012
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/API2Tools.pm | 4 ++++
www/manager/data/ResourceStore.js | 32 ++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/PVE/API2Tools.pm b/PVE/API2Tools.pm
index e7f29e2..bdf20a8 100644
--- a/PVE/API2Tools.pm
+++ b/PVE/API2Tools.pm
@@ -51,6 +51,10 @@ sub extract_vm_stats {
$entry->{mem} = ($d->[6] || 0) + 0;
$entry->{maxdisk} = ($d->[7] || 0) + 0;
$entry->{disk} = ($d->[8] || 0) + 0;
+ $entry->{netin} = ($d->[9] || 0) + 0;
+ $entry->{netout} = ($d->[10] || 0) + 0;
+ $entry->{diskread} = ($d->[11] || 0) + 0;
+ $entry->{diskwrite} = ($d->[12] || 0) + 0;
};
return $entry;
diff --git a/www/manager/data/ResourceStore.js b/www/manager/data/ResourceStore.js
index c67385b..34c0b72 100644
--- a/www/manager/data/ResourceStore.js
+++ b/www/manager/data/ResourceStore.js
@@ -143,6 +143,38 @@ Ext.define('PVE.data.ResourceStore', {
sortable: true,
width: 60
},
+ diskread: {
+ header: 'Total Disk Read',
+ type: 'integer',
+ hidden: true,
+ sortable: true,
+ renderer: PVE.Utils.format_size,
+ width: 100
+ },
+ diskwrite: {
+ header: 'Total Disk Write',
+ type: 'integer',
+ hidden: true,
+ sortable: true,
+ renderer: PVE.Utils.format_size,
+ width: 100
+ },
+ netin: {
+ header: 'Total NetIn',
+ type: 'integer',
+ hidden: true,
+ sortable: true,
+ renderer: PVE.Utils.format_size,
+ width: 100
+ },
+ netout: {
+ header: 'Total NetOut',
+ type: 'integer',
+ hidden: true,
+ sortable: true,
+ renderer: PVE.Utils.format_size,
+ width: 100
+ },
uptime: {
header: gettext('Uptime'),
type: 'integer',
--
1.7.2.5
More information about the pve-devel
mailing list