mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-24 14:45:56 +00:00
Clarification to help [HER-1885] source-report.txt empty
* SourceTagsReport
informative note if there's none of the info needed for this report
This commit is contained in:
@@ -20,6 +20,7 @@ package org.archive.crawler.reporting;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import org.archive.bdb.DisposableStoredSortedMap;
|
||||
@@ -34,9 +35,16 @@ public class SourceTagsReport extends Report {
|
||||
@Override
|
||||
public void write(PrintWriter writer) {
|
||||
|
||||
Set<String> sourceTags = stats.sourceHostDistribution.keySet();
|
||||
|
||||
if(sourceTags.isEmpty()) {
|
||||
writer.println("No source tag information. (Is 'sourceTagSeeds' enabled?)");
|
||||
return;
|
||||
}
|
||||
|
||||
writer.print("[source] [host] [#urls]\n");
|
||||
// for each source
|
||||
for (String sourceKey : stats.sourceHostDistribution.keySet()) {
|
||||
for (String sourceKey : sourceTags) {
|
||||
Map<String,AtomicLong> hostCounts =
|
||||
(Map<String,AtomicLong>)stats.sourceHostDistribution.get(sourceKey);
|
||||
// sort hosts by #urls
|
||||
|
||||
Reference in New Issue
Block a user