MCPcopy Create free account
hub / github.com/mlco2/codecarbon / test_intel_rapl

Method test_intel_rapl

tests/test_cpu.py:334–346  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

332
333 @unittest.skipUnless(sys.platform.lower().startswith("lin"), "requires Linux")
334 def test_intel_rapl(self):
335 # The new RAPL implementation prioritizes package domains over psys
336 # because package domains are more reliable and update correctly under load.
337 # When both package and psys are available, only package is used.
338 expected_cpu_details = {
339 "Processor Energy Delta_0(kWh)": 0.0,
340 "Processor Power Delta_0(kWh)": 0.0,
341 }
342
343 rapl = IntelRAPL(rapl_dir=self.rapl_dir)
344 self.assertDictEqual(
345 expected_cpu_details, rapl.get_cpu_details(duration=Time(0))
346 )
347
348 @unittest.skipUnless(sys.platform.lower().startswith("lin"), "requires Linux")
349 def test_rapl_cpu_hardware(self):

Callers

nothing calls this directly

Calls 3

get_cpu_detailsMethod · 0.95
IntelRAPLClass · 0.90
TimeClass · 0.90

Tested by

no test coverage detected