Merge pull request #759 from bnfleb/issue753

Issue #753 verify if bdb is started before generating reports
This commit is contained in:
Alex Osborne
2026-08-05 12:09:02 +09:00
committed by GitHub
4 changed files with 17 additions and 0 deletions
@@ -76,6 +76,10 @@ public class HostsReport extends Report {
@Override
public void write(final PrintWriter writer, StatisticsTracker stats) {
if (!stats.bdb.isRunning()) {
writer.println("bdb not started");
return;
}
Collection<String> keys = null;
DisposableStoredSortedMap<Long, String> hd = null;
if (maxSortSize<0 || maxSortSize>stats.serverCache.hostKeys().size()) {
@@ -33,6 +33,10 @@ public class MimetypesReport extends Report {
@Override
public void write(PrintWriter writer, StatisticsTracker stats) {
if (!stats.bdb.isRunning()) {
writer.println("bdb not started");
return;
}
// header
writer.print("[#urls] [#bytes] [mime-types]\n");
DisposableStoredSortedMap<Long,String> fd = stats.getReverseSortedCopy(stats.getFileDistribution());
@@ -32,6 +32,10 @@ public class ResponseCodeReport extends Report {
@Override
public void write(PrintWriter writer, StatisticsTracker stats) {
if (!stats.bdb.isRunning()) {
writer.println("bdb not started");
return;
}
// header
writer.print("[#urls] [rescode]\n");
@@ -36,6 +36,11 @@ public class SeedsReport extends Report {
@Override
public void write(PrintWriter writer, StatisticsTracker stats) {
if (!stats.bdb.isRunning()) {
writer.println("bdb not started");
return;
}
// Build header.
writer.print("[code] [status] [seed] [redirect]\n");