diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-21 15:33:37 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:48:16 +0200 |
| commit | 912e1b96bfa7d6c022d854fa744f719b49ca98d0 (patch) | |
| tree | 49cdaf109aa08b0149c34174ce0f00c7056221ea /frontend/src/util | |
| parent | 791b5d1e443f97adc756264878c3aae41ca0f748 (diff) | |
Add first plotting attempts for portfolios
Diffstat (limited to 'frontend/src/util')
| -rw-r--r-- | frontend/src/util/available-metrics.js | 33 | ||||
| -rw-r--r-- | frontend/src/util/date-time.test.js | 2 | ||||
| -rw-r--r-- | frontend/src/util/sidebar-space.js | 2 | ||||
| -rw-r--r-- | frontend/src/util/state-utils.js | 9 |
4 files changed, 39 insertions, 7 deletions
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()) + }) }) -}) |
