Skip to content
Snippets Groups Projects
Commit 74861db5 authored by xiaohua guan's avatar xiaohua guan Committed by Yas Naoi
Browse files

Issue #3150194 by Xiaohua Guan, yas: Monitor instance(s) by a graph view with...

Issue #3150194 by Xiaohua Guan, yas: Monitor instance(s) by a graph view with CloudWatch integration (3) (Disk Usage)
parent 1c33e76f
No related branches found
No related tags found
No related merge requests found
......@@ -37,11 +37,29 @@
['network out'].concat(json.network_out.values),
],
});
disk_chart.load({
columns: [
['x'].concat(json.disk_read.timestamps),
['disk read'].concat(json.disk_read.values),
['disk write'].concat(json.disk_write.values),
],
});
disk_operation_chart.load({
columns: [
['x'].concat(json.disk_read_operation.timestamps),
['disk read operation'].concat(json.disk_read_operation.values),
['disk write operation'].concat(json.disk_write_operation.values),
],
});
});
};
let cpu_chart = generateChart('#edit-cpu-chart');
let network_chart = generateChart('#edit-network-chart');
let disk_chart = generateChart('#edit-disk-chart');
let disk_operation_chart = generateChart('#edit-disk-operation-chart');
updateCharts();
......
......@@ -413,6 +413,10 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
'cpu' => 'CPUUtilization',
'network_in' => 'NetworkIn',
'network_out' => 'NetworkOut',
'disk_read' => 'DiskReadBytes',
'disk_write' => 'DiskWriteBytes',
'disk_read_operation' => 'DiskReadOps',
'disk_write_operation' => 'DiskWriteOps',
];
$queries = [];
foreach ($metric_names as $key => $name) {
......
......@@ -152,6 +152,26 @@ class InstanceMonitorForm extends AwsCloudContentForm {
'#type' => 'container',
];
$form['disk'] = [
'#type' => 'details',
'#title' => $this->t('Disk (Bytes)'),
'#open' => TRUE,
];
$form['disk']['disk_chart'] = [
'#type' => 'container',
];
$form['disk_operation'] = [
'#type' => 'details',
'#title' => $this->t('Disk (Operations)'),
'#open' => TRUE,
];
$form['disk_operation']['disk_operation_chart'] = [
'#type' => 'container',
];
$form['#attached']['library'][] = 'aws_cloud/aws_cloud_instance_monitor';
$form['#attached']['drupalSettings']['aws_cloud_monitor_refresh_interval']
= $this->configFactory
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment