Skip to content

Commit

Permalink
issue-525:Fix the issue where ttlagent does not work when adding othe…
Browse files Browse the repository at this point in the history
…r agent
  • Loading branch information
will-zdu committed Jul 6, 2023
1 parent d2407c2 commit 0892946
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadPoolExecutor;

/**
* TTL Java Agent.
Expand Down Expand Up @@ -218,6 +222,8 @@ public static void premain(final String agentArgs, @NonNull final Instrumentatio

final ClassFileTransformer transformer = new TtlTransformer(transformletList, isLogClassTransform());
inst.addTransformer(transformer, true);

inst.retransformClasses(ThreadPoolExecutor.class, ScheduledThreadPoolExecutor.class, PriorityBlockingQueue.class, PriorityQueue.class);
logger.info("[TtlAgent.premain] add Transformer " + transformer.getClass().getName() + " success");

logger.info("[TtlAgent.premain] end");
Expand Down

0 comments on commit 0892946

Please sign in to comment.