24 lines
378 B
Python
24 lines
378 B
Python
def thermal_cap(agent):
|
|
if not agent:
|
|
return 0.3
|
|
|
|
temp = agent.get("temp", "")
|
|
load = agent.get("load", "1 1 1")
|
|
|
|
try:
|
|
cpu = float(load.split()[0])
|
|
except:
|
|
cpu = 1.0
|
|
|
|
# safe X99 operating envelope
|
|
if "90" in temp:
|
|
return 0.2
|
|
|
|
if "80" in temp:
|
|
return 0.5
|
|
|
|
if cpu > 4:
|
|
return 0.6
|
|
|
|
return 1.0
|