This module provides functions for platform integration. Most of the functionality here could also be achieved with psutils but we want to avoid the large dependency.
Checks if the current device has AC power or is running on battery.
Trueif the device has AC power,
- Return type
- class maestral.utils.integration.ACState(value)
Enumeration of AC power states
- Connected = 'Connected'
- Disconnected = 'Disconnected'
- Undetermined = 'Undetermined'
Returns the current inotify limit settings as tuple.
Returns a float representing the CPU utilization of the current process as a percentage. This duplicates the similar method from psutil to avoid the psutil dependency.
Compares process times to system CPU times elapsed before and after the interval (blocking). It is recommended for accuracy that this function be called with an interval of at least 0.1 sec.
A value > 100.0 can be returned in case of processes running multiple threads on different CPU cores. The returned value is explicitly NOT split evenly between all available logical CPUs. This means that a busy loop process running on a system with 2 logical CPUs will be reported as having 100% CPU utilization instead of 50%.