py rapl
1.0.0
py-rapl
est une bibliothèque très simple qui prend en charge l'échantillonnage des compteurs d'énergie RAPL, ou Running Average Power Limit , fournis par la plupart, sinon la totalité, des processeurs Intel modernes.
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"))