@instance_stats_calculator<EOL>def utilization(prev, curr, counters):
busy_prop, idle_prop = counters<EOL>pb = getattr(prev, busy_prop)<EOL>pi = getattr(prev, idle_prop)<EOL>cb = getattr(curr, busy_prop)<EOL>ci = getattr(curr, idle_prop)<EOL>db = minus(cb, pb)<EOL>di = minus(ci, pi)<EOL>return mul(div(db, add(db, di)), <NUM_LIT:100>)<EOL>
calculate the utilization

    delta_busy = curr.busy - prev.busy
    delta_idle = curr.idle - prev.idle
    utilization = delta_busy / (delta_busy + delta_idle)

    :param prev: previous resource
    :param curr: current resource
    :param counters: list of two, busy ticks and idle ticks
    :return: value, NaN if invalid.