Add method to calculate avg cpu usage