Log data load time

This commit is contained in:
ceze88 2023-09-04 19:58:44 +02:00
parent a2a9774ce1
commit f53c5aae76

View File

@ -153,8 +153,11 @@ public class EpicHoppers extends SongodaPlugin {
public void onDataLoad() { public void onDataLoad() {
// Load data from DB // Load data from DB
this.dataManager.getAsyncPool().execute(() -> { this.dataManager.getAsyncPool().execute(() -> {
getLogger().info("loading data...");
long start = System.currentTimeMillis();
this.hopperManager.addHoppers(this.dataManager.loadBatch(HopperImpl.class, "placed_hoppers")); this.hopperManager.addHoppers(this.dataManager.loadBatch(HopperImpl.class, "placed_hoppers"));
this.boostManager.loadBoosts(this.dataManager.loadBatch(BoostDataImpl.class, "boosted_players")); this.boostManager.loadBoosts(this.dataManager.loadBatch(BoostDataImpl.class, "boosted_players"));
getLogger().info("Loaded " + hopperManager.getHoppers().size() + " hoppers in " + (System.currentTimeMillis() - start) + "ms");
this.hopperManager.setReady(); this.hopperManager.setReady();
}); });
} }