py rapl
1.0.0
py-rapl
은 모든 최신 Intel CPU는 아니지만 대부분에서 제공되는 RAPL 또는 Running Average Power Limit 에너지 카운터 샘플링을 지원하는 매우 간단한 라이브러리입니다.
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"))