improve ArthasAgent API. #1471

pull/1480/head
hengyunabc 4 years ago
parent 41ac103720
commit 2d4c59d1ce

@ -32,7 +32,15 @@ public class ArthasAgent {
private Instrumentation instrumentation;
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,
@ -47,6 +55,22 @@ public class ArthasAgent {
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 {
// 尝试判断arthas是否已在运行如果是的话直接就退出
try {

Loading…
Cancel
Save