private static void DisplayRuntimeStatistics() { System.Console.WriteLine("--- RUNTIME STATISTICS --------------------------------------------------------"); try { long crawled = RuntimeStatistics.getCrawledUrls(), extracted = RuntimeStatistics.getExtractedUrls(); long feedback = RuntimeStatistics.getFeedUrls(), errors = RuntimeStatistics.getTotalErrors(); long pages = RuntimeStatistics.getPagesCrawledNum(); long visited = RuntimeStatistics.getFetchedUrls(); float extarctedPercentage = extracted / crawled; float feedBackPercentage = feedback / crawled; float errorsPercentage = ((float)errors / (float)extracted) * 100; System.Console.WriteLine(" Total Crawled Urls : {0}\t\t (Rate {1} pages per refresh rate)", visited, pages); System.Console.WriteLine(" Total Results Urls : {0}", crawled); System.Console.WriteLine(" Total Extracted Urls : {0}\t\t [{1}X]", extracted, extarctedPercentage); System.Console.WriteLine(" Total FeedBack Urls : {0}\t\t [{1}X]", feedback, feedBackPercentage); System.Console.ForegroundColor = ConsoleColor.Red; System.Console.WriteLine(" Total Errors Occured : {0}\t\t [{1}%]", errors, errorsPercentage); System.Console.ForegroundColor = ConsoleColor.White; } catch (Exception e) { System.Console.WriteLine(" No Statistics Avalibale right now"); } }
private static void DisplayEntriesInSystems(long totalRequests) { System.Console.WriteLine("--- URL ENTRIES ---------------------------------------------------------------"); long frontierNum = RuntimeStatistics.getFrontierUrls(); System.Console.WriteLine(" In Frontier Core Urls : {0}", frontierNum); System.Console.WriteLine(" Url In the Crawler Queues : {0}", totalRequests); System.Console.WriteLine(" Total Urls In the Crawler : {0}", frontierNum + totalRequests); }