summaryrefslogtreecommitdiff
path: root/src/util/simulation-load.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-10-04 22:49:07 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-10-04 22:49:25 +0200
commit751a9ef3a12c952fe179f256d854d0c4aa37e28e (patch)
tree241fc22c592a277526e73cc70ea0f95d5a8a7b29 /src/util/simulation-load.js
parent9257d89ec2e22b65ffecc7dc7cf67b7a74c34d60 (diff)
Apply prettier to codebase
Diffstat (limited to 'src/util/simulation-load.js')
-rw-r--r--src/util/simulation-load.js51
1 files changed, 28 insertions, 23 deletions
diff --git a/src/util/simulation-load.js b/src/util/simulation-load.js
index 4b6233be..95e17fed 100644
--- a/src/util/simulation-load.js
+++ b/src/util/simulation-load.js
@@ -1,32 +1,37 @@
-import {SIM_HIGH_COLOR, SIM_LOW_COLOR, SIM_MID_HIGH_COLOR, SIM_MID_LOW_COLOR} from "./colors";
+import {
+ SIM_HIGH_COLOR,
+ SIM_LOW_COLOR,
+ SIM_MID_HIGH_COLOR,
+ SIM_MID_LOW_COLOR
+} from "./colors";
export const LOAD_NAME_MAP = {
- LOAD: "computational load",
- TEMPERATURE: "temperature",
- MEMORY: "memory use",
+ LOAD: "computational load",
+ TEMPERATURE: "temperature",
+ MEMORY: "memory use"
};
export function convertLoadToSimulationColor(load) {
- if (load <= 0.25) {
- return SIM_LOW_COLOR;
- } else if (load <= 0.5) {
- return SIM_MID_LOW_COLOR;
- } else if (load <= 0.75) {
- return SIM_MID_HIGH_COLOR;
- } else {
- return SIM_HIGH_COLOR;
- }
+ if (load <= 0.25) {
+ return SIM_LOW_COLOR;
+ } else if (load <= 0.5) {
+ return SIM_MID_LOW_COLOR;
+ } else if (load <= 0.75) {
+ return SIM_MID_HIGH_COLOR;
+ } else {
+ return SIM_HIGH_COLOR;
+ }
}
export function getStateLoad(loadMetric, state) {
- switch (loadMetric) {
- case "LOAD":
- return state.loadFraction;
- case "TEMPERATURE":
- return state.temperatureC / 100.0;
- case "MEMORY":
- return state.inUseMemoryMb / 10000.0;
- default:
- return -1;
- }
+ switch (loadMetric) {
+ case "LOAD":
+ return state.loadFraction;
+ case "TEMPERATURE":
+ return state.temperatureC / 100.0;
+ case "MEMORY":
+ return state.inUseMemoryMb / 10000.0;
+ default:
+ return -1;
+ }
}