Closed da-ekchajzer closed 2 years ago
INPUT
"model":{
"archetype": "dellR740"
}
"usage": {
"hours_use_time": 1,
"workload": {
"10": {
"time": 0.2,
},
"50": {
"time": 0.3
},
"100": {
"time": 0.5
},
"idle": {
"time": 0
}
}
}
complete_with_archetype should set power from dell r740
INPUT
"model":{
"archetype": "dellR740"
}
"usage": {
"max_power": 510,
"hours_use_time": 1,
"workload": {
"10": {
"time": 0.2,
"power": 0.5118
},
"50": {
"time": 0.3,
"power": 0.7235
},
"100": {
"time": 0.5,
"power": 1.0
},
"idle": {
"time": 0,
"power": 0.3941
}
}
}
Problem
Complete_with_archetype won't complete workload data if workload exist but is not complete. It's an issue if I want to give a time per workload, but I don't have the power per load (case of cloud).
Example : since workload exist, the object will be used without replacing power
ERROR : hours_electrical_consumption += values["time"] * values["power"] * self.max_power KeyError: 'power'
Solution
complete_with_archetype for usage components should have a recursive way of treating attributes for usage only.
Additional context or elements
Such use case should be unit tested