2020-05-26 10:19:04 +00:00
|
|
|
Ext.define('pve-rrd-datastore', {
|
|
|
|
extend: 'Ext.data.Model',
|
|
|
|
fields: [
|
|
|
|
'used',
|
|
|
|
'total',
|
|
|
|
'read_ios',
|
|
|
|
'read_bytes',
|
|
|
|
'write_ios',
|
|
|
|
'write_bytes',
|
2020-05-28 17:11:37 +00:00
|
|
|
'io_ticks',
|
2020-05-26 10:19:04 +00:00
|
|
|
{
|
2020-05-28 17:11:37 +00:00
|
|
|
name: 'io_delay', calculate: function(data) {
|
|
|
|
let ios = 0;
|
|
|
|
if (data.read_ios !== undefined) { ios += data.read_ios; }
|
|
|
|
if (data.write_ios !== undefined) { ios += data.write_ios; }
|
2020-06-23 08:30:15 +00:00
|
|
|
if (data.io_ticks === undefined) {
|
2020-05-26 10:19:04 +00:00
|
|
|
return undefined;
|
2020-06-23 08:30:15 +00:00
|
|
|
} else if (ios === 0) {
|
|
|
|
return 0;
|
2020-05-26 10:19:04 +00:00
|
|
|
}
|
2020-05-28 17:11:37 +00:00
|
|
|
return (data.io_ticks*1000.0)/ios;
|
2020-09-25 16:36:58 +00:00
|
|
|
},
|
2020-05-26 10:19:04 +00:00
|
|
|
},
|
2020-09-25 16:36:58 +00:00
|
|
|
{ type: 'date', dateFormat: 'timestamp', name: 'time' },
|
|
|
|
],
|
2020-05-26 10:19:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
Ext.define('PBS.DataStoreStatistic', {
|
|
|
|
extend: 'Ext.panel.Panel',
|
|
|
|
alias: 'widget.pbsDataStoreStatistic',
|
|
|
|
|
|
|
|
title: gettext('Statistics'),
|
|
|
|
|
|
|
|
scrollable: true,
|
|
|
|
|
|
|
|
initComponent: function() {
|
|
|
|
var me = this;
|
|
|
|
|
|
|
|
if (!me.datastore) {
|
|
|
|
throw "no datastore specified";
|
|
|
|
}
|
|
|
|
|
2020-09-25 16:36:58 +00:00
|
|
|
me.tbar = ['->', { xtype: 'proxmoxRRDTypeSelector' }];
|
2020-05-26 10:19:04 +00:00
|
|
|
|
|
|
|
var rrdstore = Ext.create('Proxmox.data.RRDStore', {
|
|
|
|
rrdurl: "/api2/json/admin/datastore/" + me.datastore + "/rrd",
|
2020-09-25 16:36:58 +00:00
|
|
|
model: 'pve-rrd-datastore',
|
2020-05-26 10:19:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
me.items = {
|
|
|
|
xtype: 'container',
|
|
|
|
itemId: 'itemcontainer',
|
|
|
|
layout: 'column',
|
|
|
|
minWidth: 700,
|
|
|
|
defaults: {
|
|
|
|
minHeight: 320,
|
|
|
|
padding: 5,
|
2020-09-25 16:36:58 +00:00
|
|
|
columnWidth: 1,
|
2020-05-26 10:19:04 +00:00
|
|
|
},
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxRRDChart',
|
2020-05-28 08:20:29 +00:00
|
|
|
title: gettext('Storage usage (bytes)'),
|
2020-09-25 16:36:58 +00:00
|
|
|
fields: ['total', 'used'],
|
2020-05-26 10:19:04 +00:00
|
|
|
fieldTitles: [gettext('Total'), gettext('Storage usage')],
|
2020-09-25 16:36:58 +00:00
|
|
|
store: rrdstore,
|
2020-05-26 10:19:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxRRDChart',
|
2020-05-28 08:20:29 +00:00
|
|
|
title: gettext('Transfer Rate (bytes/second)'),
|
2020-09-25 16:36:58 +00:00
|
|
|
fields: ['read_bytes', 'write_bytes'],
|
2020-05-28 08:20:29 +00:00
|
|
|
fieldTitles: [gettext('Read'), gettext('Write')],
|
2020-09-25 16:36:58 +00:00
|
|
|
store: rrdstore,
|
2020-05-28 08:20:29 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxRRDChart',
|
|
|
|
title: gettext('Input/Output Operations per Second (IOPS)'),
|
2020-09-25 16:36:58 +00:00
|
|
|
fields: ['read_ios', 'write_ios'],
|
2020-05-28 08:20:29 +00:00
|
|
|
fieldTitles: [gettext('Read'), gettext('Write')],
|
2020-09-25 16:36:58 +00:00
|
|
|
store: rrdstore,
|
2020-05-26 10:19:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxRRDChart',
|
2020-05-28 17:11:37 +00:00
|
|
|
title: gettext('IO Delay (ms)'),
|
|
|
|
fields: ['io_delay'],
|
|
|
|
fieldTitles: [gettext('IO Delay')],
|
2020-09-25 16:36:58 +00:00
|
|
|
store: rrdstore,
|
2020-05-26 10:19:04 +00:00
|
|
|
},
|
2020-09-25 16:36:58 +00:00
|
|
|
],
|
2020-05-26 10:19:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
me.listeners = {
|
|
|
|
activate: function() {
|
|
|
|
rrdstore.startUpdate();
|
|
|
|
},
|
|
|
|
destroy: function() {
|
|
|
|
rrdstore.stopUpdate();
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
me.callParent();
|
2020-09-25 16:36:58 +00:00
|
|
|
},
|
2020-05-26 10:19:04 +00:00
|
|
|
|
|
|
|
});
|