Fix multihtreading bug with metric plotting