In this case it is recommended for accuracy that this function be called with at least 0.1 seconds between calls. That means the first time this is called it will return a meaningless 0.0 value which you are supposed to ignore. When interval is 0.0 or None compares system CPU times elapsed since last call or module import, returning immediately. When interval is > 0.0 compares system CPU times elapsed before and after the interval (blocking). Return a float representing the current system-wide CPU utilization as a percentage. Psutil.cpu_percent(interval=None, percpu=False) Individual CPUs: 11.00% 8.50% 11.90% 8.50% 9.90% 7.60% 11.50% 12.30%įor more information on how the psutil.cpu_percent(interval=2) python call works, see the official psutil.cpu_percent(interval=None, percpu=False) documentation here: Sample output: notice that I have 8 cores, so there are 8 numbers after "Individual CPUs:": Total: 10.15% printf "%b" "import psutil\nprint(''.format(' '.join(cpu_percent_cores_str)))\n\ This calls python3 and uses the cross-platform psutil module. This is typically different (higher) than the wattage for servers.Do this to see the overall CPU usage. This would allow you to calculate volt-amps. You may want to invest in or borrow a current meter which works by clipping around the wire. However, they require disconnecting the device so that the power runs through the device. There are devices like Kill-A-Watt that can be used to measure power consumption. Adding new devices or replacing existing ones may alter the power load. This is probably a good place to start and estimate. The manufacturers specs will give you some idea of power consumption, but reconfiguration of hardware can change power consumption. UPSs care about power consumption and often have accessible data. Other tools will aggressively tune down power consumption. Tools like powertop will track processes which trigger increases in power consumption. Power consumption can vary widely over time depending on workload. It is common that there are voltage sensors that are readable. Computers generally don't track the current they are drawing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |