Wanting to find out how much power does a program need to run? Current tools such as Intel Power Gadget only measure the power usage or your computer, but not your program. ApplicationPowerManager solves your problem by allowing you to estimate the power usage of one application.
ApplicationPowerManager use EnergyLib64.dll provided by Intel Power Gadget.
- Make sure you have
Pythonversion 3.9 or later installed. - Download the zip file in the latest release into a new folder, unzip it and run
ApplicationPowerManager.pyto run the ApplicationPowerManager- One way to run is open terminal at current folder, run using command
python ApplicationPowerManager.py - Measuring without charging in action (for laptop user) might produce more correct result.
- One way to run is open terminal at current folder, run using command
- Upon running the ApplicationPowerManager, you will see the message
Please wait a moment.... - After a few seconds, a new message will appear
Now run the application you want to measure the power usage.and a confirmation is requiredHave you run it? (yes/no) - Now you need to run the application you want to measure.
- Confirming your application is running by replying
yes - Wait and see the result.
ApplicationPowerManager retrieves and calculates difference of power usage before and after you run the application you want to measure and output the estimation of power usage required.
Load the Intel Power Gadget library EnergyLib64.dll and initialize it.
Use API from EnergyLib64.dll to measure the average power usage when calling ReadSample() and save into specified csv file.
- Before you run the application you want to measure, measure the power usage and save into
PowerGadgetLogBefore.csv. - After confirming you have run the application you want to measure, measure the power usage again and save into
PowerGadgetLogAfter.csv. - Retrieving the
Average Processer Powerand calculate the difference.- Result output might be a message that says the result is 0 or there is an error somewhere. You need to run the application again.
- ApplicationPowerManager only provides the estimation, and may generate different result if there is a background application that end or start during measuring and logging
PowerGadgetLogAfter.csv, so multiple try should be done to obtain the closet estimation (run the ApplicationPowerManager multiple time and record the result, afterwards decide the closet estimation).- For example after running ApplicationPowerManager multiple times and obtains results
2.23, 1.97, 2.4, 5.52, 0.99we can see that the estimation would be around2.2with values5.52and0.99be the outliner.
- For example after running ApplicationPowerManager multiple times and obtains results
- Result output might be a message that says the result is 0 or there is an error somewhere, it might be caused by another application using a greater amount of power end during the estimating. You have to run the application again in this case.