To monitor the CPU and memory utilization you can use this class
Classpstats - Python class to monitor CPU / Memory utilization