py rapl
1.0.0
py-rapl
é uma biblioteca muito simples que suporta amostragem de RAPL, ou contadores de energia Running Average Power Limit que são fornecidos pela maioria, senão por todas as CPUs Intel modernas.
import rapl
s1 = rapl.RAPLMonitor.sample()
# Some work that you want to measure.
s2 = rapl.RAPLMonitor.sample()
# Take the difference of the samples
diff = s2 - s1
# Print the difference in microjoules
print(diff.energy("package-0", "core", rapl.UJOULES))
# Print the average power
print(diff.average_power("package-0", "core"))