Report total bytes, as well as breakdown, in xml version of job page, to match

html.
* CrawlJob.java
    sizeTotalsReportData() - add "total" (bytes) and "total-count" (urls) to map
* CrawledBytesHistotable.java
    new method getTotalUrls() to complement getTotalBytes()
This commit is contained in:
nlevitt committed 2011-02-09 01:17:26 +00:00
1 parent f58fdcdba4
commit 9468cb0c1f
2 files changed
+11 -1

No files matched your search

@@ -31,6 +31,7 @@ import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.logging.FileHandler;
import java.util.logging.Formatter;
import java.util.logging.Handler;
@@ -797,7 +798,12 @@ public class CrawlJob implements Comparable<CrawlJob>, ApplicationListener {
if(stats==null) {
return null;
}
return stats.getCrawledBytes();
// stats.crawledBytesSummary() also includes totals, so add those in here
TreeMap<String, Long> map = new TreeMap<String,Long>(stats.getCrawledBytes());
map.put("total", stats.getCrawledBytes().getTotalBytes());
map.put("total-count", stats.getCrawledBytes().getTotalUrls());
return map;
}
public String sizeTotalsReport() {
@@ -79,4 +79,8 @@ implements CoreAttributeConstants {
public long getTotalBytes() {
return get(NOVEL) + get(DUPLICATE) + get(NOTMODIFIED);
}
public long getTotalUrls() {
return get(NOVELCOUNT) + get(DUPLICATECOUNT) + get(NOTMODIFIEDCOUNT);
}
}