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