From 912e1b96bfa7d6c022d854fa744f719b49ca98d0 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Tue, 21 Jul 2020 15:33:37 +0200 Subject: Add first plotting attempts for portfolios --- frontend/src/util/available-metrics.js | 33 +++++++++++++++++++++++++++++++-- frontend/src/util/date-time.test.js | 2 +- frontend/src/util/sidebar-space.js | 2 ++ frontend/src/util/state-utils.js | 9 +++++---- 4 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 frontend/src/util/sidebar-space.js (limited to 'frontend/src/util') diff --git a/frontend/src/util/available-metrics.js b/frontend/src/util/available-metrics.js index c8035ddd..6522a849 100644 --- a/frontend/src/util/available-metrics.js +++ b/frontend/src/util/available-metrics.js @@ -1,4 +1,33 @@ export const AVAILABLE_METRICS = [ - 'granted-cpu', - 'overcommitted-cpu', + 'total_overcommitted_burst', + 'total_granted_burst', + 'total_requested_burst', + 'total_interfered_burst', + 'total_power_draw', + 'mean_cpu_usage', + 'mean_cpu_demand', + 'mean_num_deployed_images', + 'max_num_deployed_images', + 'total_failure_vm_slices', + 'total_vms_submitted', + 'total_vms_queued', + 'total_vms_finished', + 'total_vms_failed', ] + +export const METRIC_NAMES = { + total_overcommitted_burst: 'Overcomm. CPU Cycles [MFLOP]', + total_granted_burst: 'Granted CPU Cycles [MFLOP]', + total_requested_burst: 'Requested CPU Cycles [MFLOP]', + total_interfered_burst: 'Interfered CPU Cycles [MFLOP]', + total_power_draw: 'Total Power Consumption [Wh]', + mean_cpu_usage: 'Mean Host CPU Usage [MHz]', + mean_cpu_demand: 'Mean Host CPU Demand [MHz]', + mean_num_deployed_images: 'Mean Num. Deployed Images Per Host', + max_num_deployed_images: 'Max. Num. Deployed Images Per Host', + total_failure_vm_slices: 'Total Num. Failed VM Slices', + total_vms_submitted: 'Total Num. VMs Submitted', + total_vms_queued: 'Max. Num. VMs Queued', + total_vms_finished: 'Max. Num. VMs Finished', + total_vms_failed: 'Max. Num. VMs Failed', +} diff --git a/frontend/src/util/date-time.test.js b/frontend/src/util/date-time.test.js index 9274d4b7..3d95eba6 100644 --- a/frontend/src/util/date-time.test.js +++ b/frontend/src/util/date-time.test.js @@ -15,7 +15,7 @@ describe('date-time parsing', () => { }) describe('tick formatting', () => { - it('returns \'0s\' for numbers <= 0', () => { + it("returns '0s' for numbers <= 0", () => { expect(convertSecondsToFormattedTime(-1)).toEqual('0s') expect(convertSecondsToFormattedTime(0)).toEqual('0s') }) diff --git a/frontend/src/util/sidebar-space.js b/frontend/src/util/sidebar-space.js new file mode 100644 index 00000000..ef09d40a --- /dev/null +++ b/frontend/src/util/sidebar-space.js @@ -0,0 +1,2 @@ +export const isCollapsible = (location) => + location.pathname.indexOf('portfolios') === -1 && location.pathname.indexOf('scenarios') === -1 diff --git a/frontend/src/util/state-utils.js b/frontend/src/util/state-utils.js index ba248c60..e5b695c3 100644 --- a/frontend/src/util/state-utils.js +++ b/frontend/src/util/state-utils.js @@ -1,5 +1,6 @@ -export const getState = (dispatch) => new Promise((resolve) => { - dispatch((dispatch, getState) => { - resolve(getState()) +export const getState = (dispatch) => + new Promise((resolve) => { + dispatch((dispatch, getState) => { + resolve(getState()) + }) }) -}) -- cgit v1.2.3 From 2ed4052162e2fcfa49f55cdd7f77cc2595526169 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Tue, 21 Jul 2020 15:50:20 +0200 Subject: Fix overflow and rearrange --- frontend/src/util/available-metrics.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'frontend/src/util') diff --git a/frontend/src/util/available-metrics.js b/frontend/src/util/available-metrics.js index 6522a849..07f46456 100644 --- a/frontend/src/util/available-metrics.js +++ b/frontend/src/util/available-metrics.js @@ -1,14 +1,14 @@ export const AVAILABLE_METRICS = [ 'total_overcommitted_burst', + 'total_power_draw', + 'total_failure_vm_slices', 'total_granted_burst', - 'total_requested_burst', 'total_interfered_burst', - 'total_power_draw', + 'total_requested_burst', 'mean_cpu_usage', 'mean_cpu_demand', 'mean_num_deployed_images', 'max_num_deployed_images', - 'total_failure_vm_slices', 'total_vms_submitted', 'total_vms_queued', 'total_vms_finished', -- cgit v1.2.3 From 3c03c08f996c1cd2bc26bac7bb72a5e61cad6338 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Wed, 22 Jul 2020 11:14:03 +0200 Subject: Add error bars --- frontend/src/util/available-metrics.js | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'frontend/src/util') diff --git a/frontend/src/util/available-metrics.js b/frontend/src/util/available-metrics.js index 07f46456..ed11f5f7 100644 --- a/frontend/src/util/available-metrics.js +++ b/frontend/src/util/available-metrics.js @@ -16,13 +16,13 @@ export const AVAILABLE_METRICS = [ ] export const METRIC_NAMES = { - total_overcommitted_burst: 'Overcomm. CPU Cycles [MFLOP]', - total_granted_burst: 'Granted CPU Cycles [MFLOP]', - total_requested_burst: 'Requested CPU Cycles [MFLOP]', - total_interfered_burst: 'Interfered CPU Cycles [MFLOP]', - total_power_draw: 'Total Power Consumption [Wh]', - mean_cpu_usage: 'Mean Host CPU Usage [MHz]', - mean_cpu_demand: 'Mean Host CPU Demand [MHz]', + total_overcommitted_burst: 'Overcomm. CPU Cycles', + total_granted_burst: 'Granted CPU Cycles', + total_requested_burst: 'Requested CPU Cycles', + total_interfered_burst: 'Interfered CPU Cycles', + total_power_draw: 'Total Power Consumption', + mean_cpu_usage: 'Mean Host CPU Usage', + mean_cpu_demand: 'Mean Host CPU Demand', mean_num_deployed_images: 'Mean Num. Deployed Images Per Host', max_num_deployed_images: 'Max. Num. Deployed Images Per Host', total_failure_vm_slices: 'Total Num. Failed VM Slices', @@ -31,3 +31,20 @@ export const METRIC_NAMES = { total_vms_finished: 'Max. Num. VMs Finished', total_vms_failed: 'Max. Num. VMs Failed', } + +export const METRIC_UNITS = { + total_overcommitted_burst: 'MFLOP', + total_granted_burst: 'MFLOP', + total_requested_burst: 'MFLOP', + total_interfered_burst: 'MFLOP', + total_power_draw: 'Wh', + mean_cpu_usage: 'MHz', + mean_cpu_demand: 'MHz', + mean_num_deployed_images: 'VMs', + max_num_deployed_images: 'VMs', + total_failure_vm_slices: 'VM Slices', + total_vms_submitted: 'VMs', + total_vms_queued: 'VMs', + total_vms_finished: 'VMs', + total_vms_failed: 'VMs', +} -- cgit v1.2.3