Count number of queue and add debug information.