Skip to content

Commit

Permalink
Improve logging of cache loading
Browse files Browse the repository at this point in the history
  • Loading branch information
makamys committed Oct 24, 2023
1 parent 95d072f commit 3f1a035
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,13 @@ public void load() {
cache.clear();
epoch = 0;
}
long t1 = System.nanoTime();
LOGGER.debug("Loaded jar discoverer cache with " + cache.size() + " entries in " + (t1-t0) / 1_000_000_000.0 + "s");
} else {
long t1 = System.nanoTime();
LOGGER.debug("Created new jar discoverer cache in " + (t1-t0) / 1_000_000_000.0 + "s");
}

long t1 = System.nanoTime();
LOGGER.debug("Loaded jar discoverer cache in " + (t1-t0) / 1_000_000_000.0 + "s");

hasLoaded = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,16 @@ private void loadData() {
DAT.renameTo(DAT_ERRORED);
e.printStackTrace();
}
long t1 = System.nanoTime();
LOGGER.debug("Loaded lite transformer cache with " + getSize() + " entries in " + ((t1-t0) / 1_000_000_000.0) + "s");
} else {
long t1 = System.nanoTime();
LOGGER.debug("Created new lite transformer cache in " + ((t1-t0) / 1_000_000_000.0) + "s");
}

long t1 = System.nanoTime();
LOGGER.debug("Loaded lite transformer cache in " + ((t1-t0) / 1_000_000_000.0) + "s");
}

private int getSize() {
return transformerMap.values().stream().mapToInt(d -> d.transformationMap.size()).sum();
}

private static Map<String, TransformerData> returnVerifiedTransformerMap(Map<String, TransformerData> map) {
Expand Down

0 comments on commit 3f1a035

Please sign in to comment.