From f1d6e52ff4ae8cd6e1421b5d79075f931d12c597 Mon Sep 17 00:00:00 2001 From: "qinqiang.qq" Date: Thu, 2 Apr 2020 15:36:20 +0800 Subject: [PATCH 1/2] support loading agent dynamically --- pom.xml | 5 +++-- .../java/com/alibaba/ttl/threadpool/agent/TtlAgent.java | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 95c210d47..55ce872e4 100644 --- a/pom.xml +++ b/pom.xml @@ -221,8 +221,8 @@ maven-compiler-plugin 3.8.1 - 1.6 - 1.6 + 1.7 + 1.7 ${project.build.sourceEncoding} @@ -266,6 +266,7 @@ - https://docs.oracle.com/javase/10/docs/specs/jar/jar.html#jar-manifest --> com.alibaba.ttl.threadpool.agent.TtlAgent + com.alibaba.ttl.threadpool.agent.TtlAgent ${project.artifactId}-${project.version}.jar false true diff --git a/src/main/java/com/alibaba/ttl/threadpool/agent/TtlAgent.java b/src/main/java/com/alibaba/ttl/threadpool/agent/TtlAgent.java index ed9489204..86d656311 100644 --- a/src/main/java/com/alibaba/ttl/threadpool/agent/TtlAgent.java +++ b/src/main/java/com/alibaba/ttl/threadpool/agent/TtlAgent.java @@ -152,6 +152,13 @@ public static void premain(String agentArgs, @NonNull Instrumentation inst) { } } + /** + * add entry to support attaching agent dynamically + */ + public static void agentmain(String agentArgs, @NonNull Instrumentation inst){ + premain(agentArgs, inst); + } + private static String getLogImplTypeFromAgentArgs(@NonNull final Map kvs) { return kvs.get(Logger.TTL_AGENT_LOGGER_KEY); } From fb47e05dc1117e94e68ffa6dd176a651b91aabe1 Mon Sep 17 00:00:00 2001 From: "qinqiang.qq" Date: Thu, 2 Apr 2020 16:13:31 +0800 Subject: [PATCH 2/2] change back to 1.6 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 55ce872e4..636e28786 100644 --- a/pom.xml +++ b/pom.xml @@ -221,8 +221,8 @@ maven-compiler-plugin 3.8.1 - 1.7 - 1.7 + 1.6 + 1.6 ${project.build.sourceEncoding}