Skip to content

Library to provide access to Intel RAPL energy counters via Python.

License

Notifications You must be signed in to change notification settings

wkatsak/py-rapl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-rapl: a very simple library to sample RAPL counters via powercap/sysfs interface

Introduction

py-rapl is a very simple library that supports sampling the RAPL, or Running Average Power Limit energy counters that are provided by most, if not all modern Intel CPUs.

Usage

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"))

About

Library to provide access to Intel RAPL energy counters via Python.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages