private void setupMetrics() {
        Gauge<Integer> numberOfLinksGauge = () -> scheduler.numberOfLinks();
        metricsManager.register("frontier_manager.scheduler.number_of_links", numberOfLinksGauge);
        
        Gauge<Integer> nonExpiredDomainsGauge = () -> scheduler.numberOfNonExpiredDomains();
        metricsManager.register("frontier_manager.scheduler.non_expired_domains", nonExpiredDomainsGauge);
        
        Gauge<Integer> emptyDomainsGauge = () -> scheduler.numberOfEmptyDomains();
        metricsManager.register("frontier_manager.scheduler.empty_domains", emptyDomainsGauge);
        
        Gauge<Integer> availableLinksGauge = () -> availableLinksDuringLoad;
        metricsManager.register("frontier_manager.last_load.available", availableLinksGauge);

        Gauge<Integer> rejectedLinksGauge = () -> rejectedLinksDuringLoad;
        metricsManager.register("frontier_manager.last_load.rejected", rejectedLinksGauge);
        
        Gauge<Integer> uncrawledLinksGauge = () -> uncrawledLinksDuringLoad;
        metricsManager.register("frontier_manager.last_load.uncrawled", uncrawledLinksGauge);
        
        frontierLoadTimer = metricsManager.getTimer("frontier_manager.load.time");
    }
This class manages the crawler scheduling process. All links known by the crawler are stored in
the Frontier (which is usually very large to fit in main memory). These links are periodically
loaded into the scheduler (in-memory) based on their link priorities. Not all links can be
loaded, so LinkSelector are used to determine which links should be loaded from the frontier to
the scheduler. In order to be efficient and keep a high crawling rate, the scheduler should
always have links available to be returned to the crawler agent
(#{@link achecrawler.crawler.async.AsyncCrawler).

@author aeciosantos
ache/src/main/java/achecrawler/link/frontier/CrawlScheduler.java