Skip to content

Commit

Permalink
color big layers
Browse files Browse the repository at this point in the history
  • Loading branch information
msbarry committed Sep 16, 2023
1 parent 42d8cf5 commit a663fed
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,18 @@ public void printStats() {
)).collect(Collectors.joining("\n")));
}

LOGGER.debug("Max tile sizes:\n{}\n{}",
writeStatsTable(result, formatter::storage, SummaryCell::maxSize),
LOGGER.debug("Max tile sizes:\n{}\n{}\n{}",
writeStatsTable(result, n -> {
String string = " " + formatter.storage(n, true);
return n.intValue() > 500_000 ? AnsiColors.red(string) :
n.intValue() > 100_000 ? AnsiColors.yellow(string) :
string;
}, SummaryCell::maxSize),
writeStatsRow(result, "full tile",
formatter::storage,
z -> result.get(z).maxSize(),
result.get().maxSize()
),
writeStatsRow(result, "gzipped",
formatter::storage,
z -> result.get(z).maxArchivedSize(),
Expand Down Expand Up @@ -345,16 +355,7 @@ private static String writeStatsTable(Summary result, Function<Number, String> f
extractStat.apply(result.get(layer))
)).append('\n');
}

// last layer: total sizes
builder.append(writeStatsRow(
result,
"full tile",
formatter,
z -> extractStat.apply(result.get(z)),
extractStat.apply(result.get())
));
return builder.toString();
return builder.toString().stripTrailing();
}

public Updater threadLocalUpdater() {
Expand Down

0 comments on commit a663fed

Please sign in to comment.