# Get queue status problem

**URL:** <https://discuss.hangfire.io/t/get-queue-status-problem/1837>\
**Category:** question\
**Created:** [March 3, 2016, 4:58pm UTC](https://discuss.hangfire.io/t/get-queue-status-problem/1837 "2016-03-03T16:58:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeadMagnet](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/leadmagnet/32/548_2.png) [@LeadMagnet](https://discuss.hangfire.io/u/LeadMagnet)\
**Post date:** [March 3, 2016, 4:58pm UTC](https://discuss.hangfire.io/t/get-queue-status-problem/1837/1 "2016-03-03T16:58:13Z")

</div>

First off, Hangfire is running prefectly. I have a single server with a dynamic number of queues being created. Jobs assigned to these queues run successfully. Everything is working.

I have been trying to get the status of the queues without success. What I want to do is check the queues periodically and see if they are finished. Problem is I cannot figure out how to do this when:

- The queue has jobs in it
- The queue is empty

The code I have been running is…

Hangfire.Storage.IMonitoringApi monitor = JobStorage.Current.GetMonitoringApi;  
Storage.Monitoring.QueueWithTopEnqueuedJobsDto myQ = New Storage.Monitoring.QueueWithTopEnqueuedJobsDto();

foreach (myQ in monitor.Queues) {  
txtStatus.Text += “[” + myQ.Name + "] - " + myQ.Length + “\n”;  
}

If the queue has jobs in it, the above runs fine. If the queue does not, it returns nothing.

If anyone has a suggestion, I’d really like to hear it.

Thanks
