/** * adds the specified amount to the extracted urls counter */ public static void addToExtractedUrls(Long amount) { lock (extractedUrls) { extractedUrls = extractedUrls + amount; } }
/** * adds the specified amount to the extracted urls counter */ public static void addToFeedUrls(Long amount) { lock (feedUrls) { feedUrls = feedUrls + amount; } }
/** * adds the specified amount to the errors counter */ public static void addToErrors(Long amount) { lock (totalErrors) { totalErrors = totalErrors + amount; } }
/** * adds the specified amount to the crawled urls counter */ public static void addToCrawledUrls(Long amount) { lock (crawledUrls) { crawledUrls = crawledUrls + amount; } }
/** * adds the specified amount to the fetched urls counter */ public static void addToFetchedUrls(Long amount) { lock (fetchedUrls) { fetchedUrls = fetchedUrls + amount; } lock (PagesCrawled) { PagesCrawled = PagesCrawled + amount; } }
/** * sets the specified amount to the frontier urls counter */ public static void setFrontierUrls(Long amount) { lock (frontierUrls) { frontierUrls = amount; } }
/** * resets the counters */ public static void resetStatistics() { crawledUrls = 0; totalErrors = 0; extractedUrls = 0; feedUrls = 0; PagesCrawled = 0; fetchedUrls = 0; frontierUrls = 0; }
/** * returns the number of pages has been crawled since the last time this * function has been called */ public static long getPagesCrawledNum() { lock (PagesCrawled) { long lastValue = PagesCrawled; PagesCrawled = 0; return lastValue; } }