def calculate_usage(self, cpu, total, busy):
diff_total = total - self.prev_total[cpu]<EOL>diff_busy = busy - self.prev_busy[cpu]<EOL>self.prev_total[cpu] = total<EOL>self.prev_busy[cpu] = busy<EOL>if diff_total == <NUM_LIT:0>:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>return int(diff_busy / diff_total * <NUM_LIT:100>)<EOL><DEDENT>
calculates usage