Skip to content

Commit

Permalink
Reduce log frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
hexiaofeng committed Jan 15, 2025
1 parent 852cec4 commit a4215dd
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import net.bytebuddy.agent.builder.AgentBuilder.PoolStrategy;

import java.lang.instrument.Instrumentation;
import java.util.concurrent.ThreadLocalRandom;

/**
* PoolHandler
Expand Down Expand Up @@ -68,7 +69,9 @@ private void addCleanTask() {
int old = poolCache.size();
poolCache.recycle(enhanceConfig.getPoolExpireTime());
int current = poolCache.size();
logger.info("Clean expired cache from byte buddy pool. " + old + " -> " + current);
if (old != current || ThreadLocalRandom.current().nextInt(10) == 0) {
logger.info("Clean expired cache from byte buddy pool. " + old + " -> " + current);
}
addCleanTask();
});
}
Expand Down

0 comments on commit a4215dd

Please sign in to comment.