diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-22 14:07:39 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:48:18 +0200 |
| commit | 92ce9387f5c3ce54b4077ef6a5f604fc2cfe6ade (patch) | |
| tree | 90432dbd06a13d300f8307dea342f4639c9c57e7 /frontend/src/util | |
| parent | ae8f03d514ba0982a34b96f1e29e262ca6048a19 (diff) | |
| parent | 8739a156b75ba96e15d1bb19b08ca829c1eb01e8 (diff) | |
Merge pull request #12 from atlarge-research/feature/scenario-plots
Plotting of portfolio results
Diffstat (limited to 'frontend/src/util')
| -rw-r--r-- | frontend/src/util/available-metrics.js | 50 | ||||
| -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, 56 insertions, 7 deletions
diff --git a/frontend/src/util/available-metrics.js b/frontend/src/util/available-metrics.js index c8035ddd..ed11f5f7 100644 --- a/frontend/src/util/available-metrics.js +++ b/frontend/src/util/available-metrics.js @@ -1,4 +1,50 @@ export const AVAILABLE_METRICS = [ - 'granted-cpu', - 'overcommitted-cpu', + 'total_overcommitted_burst', + 'total_power_draw', + 'total_failure_vm_slices', + 'total_granted_burst', + 'total_interfered_burst', + 'total_requested_burst', + 'mean_cpu_usage', + 'mean_cpu_demand', + 'mean_num_deployed_images', + 'max_num_deployed_images', + 'total_vms_submitted', + 'total_vms_queued', + 'total_vms_finished', + 'total_vms_failed', ] + +export const METRIC_NAMES = { + 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', + 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', +} + +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', +} 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()) + }) }) -}) |
