class QueueMetricMonitor {

    public void monitor(String resourcePoolId) throws Throwable
    {
        DataObjectResponse<Insight> insightObjectFeed =
            insightClient.getObjects(Collections.singletonList(new ByResourcePoolId(resourcePoolId)));
        if(insightObjectFeed.isError())
        {
            logger.error("Error getting any insights by resourcePoolId: {}", resourcePoolId);
            reportFailed("resourcePool");
            return;
        }
        if(insightObjectFeed.getAll() == null || insightObjectFeed.getAll().size() == 0)
        {
            logger.info("No insights found for ResourcePool: {}", resourcePoolId);
            return;
        }

        for(Insight insight : insightObjectFeed.getAll())
        {
            // simple space replace for
            String insightTitle = getReportSafeInsightTitle(insight);
            try
            {
                DataObjectFeed feed = readyAgendaPersister.retrieve(Arrays.asList(new ByInsightId(insight.getId())));
                Integer waitingAgendaCount = feed.getAll() != null ? feed.getAll().size() : 0;
                if(waitingAgendaCount != null && waitingAgendaCount > 0)
                    reportWaiting(insightTitle, waitingAgendaCount);

                logger.info("Insight: {} Waiting: {}", insightTitle, waitingAgendaCount);
            }
            catch(Exception e)
            {
                logger.error("Failed to process ResourcePool: {} Insight: {}", resourcePoolId, insightTitle, e);
                reportFailed(insightTitle);
            }
        }
        logger.info("Processed ResourcePool: {}", resourcePoolId);
    }

    public  QueueMetricMonitor(
        ObjectPersister<ReadyAgenda> readyAgendaPersister,
        ObjectClient<Insight> insightClient,
        MetricReporter metricReporter);

}