|
|
@ -32,7 +32,15 @@ public class ArthasAgent {
|
|
|
|
private Instrumentation instrumentation;
|
|
|
|
private Instrumentation instrumentation;
|
|
|
|
|
|
|
|
|
|
|
|
public ArthasAgent() {
|
|
|
|
public ArthasAgent() {
|
|
|
|
|
|
|
|
this(null, null, false, null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ArthasAgent(Map<String, String> configMap) {
|
|
|
|
|
|
|
|
this(configMap, null, false, null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ArthasAgent(String arthasHome) {
|
|
|
|
|
|
|
|
this(null, arthasHome, false, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ArthasAgent(Map<String, String> configMap, String arthasHome, boolean slientInit,
|
|
|
|
public ArthasAgent(Map<String, String> configMap, String arthasHome, boolean slientInit,
|
|
|
@ -47,6 +55,22 @@ public class ArthasAgent {
|
|
|
|
new ArthasAgent().init();
|
|
|
|
new ArthasAgent().init();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @see https://arthas.aliyun.com/doc/arthas-properties.html
|
|
|
|
|
|
|
|
* @param configMap
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public static void attach(Map<String, String> configMap) {
|
|
|
|
|
|
|
|
new ArthasAgent(configMap).init();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* use the specified arthas
|
|
|
|
|
|
|
|
* @param arthasHome arthas directory
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public static void attach(String arthasHome) {
|
|
|
|
|
|
|
|
new ArthasAgent().init();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void init() throws IllegalStateException {
|
|
|
|
public void init() throws IllegalStateException {
|
|
|
|
// 尝试判断arthas是否已在运行,如果是的话,直接就退出
|
|
|
|
// 尝试判断arthas是否已在运行,如果是的话,直接就退出
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|