From 175e7526d68c6910557ad85c826182ca4af4bf1d Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Fri, 15 Sep 2023 18:48:09 +0800 Subject: [PATCH] improve UserStatUtil --- .../java/com/taobao/arthas/core/util/UserStatUtil.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/taobao/arthas/core/util/UserStatUtil.java b/core/src/main/java/com/taobao/arthas/core/util/UserStatUtil.java index 01b9896f3e..9d30c2ed9e 100644 --- a/core/src/main/java/com/taobao/arthas/core/util/UserStatUtil.java +++ b/core/src/main/java/com/taobao/arthas/core/util/UserStatUtil.java @@ -54,6 +54,9 @@ public static void setAgentId(String id) { } public static void arthasStart() { + if (statUrl == null) { + return; + } RemoteJob job = new RemoteJob(); job.appendQueryData("ip", ip); job.appendQueryData("version", version); @@ -69,7 +72,7 @@ public static void arthasStart() { } } - public static void arthasUsage(String cmd, String detail) { + private static void arthasUsage(String cmd, String detail) { RemoteJob job = new RemoteJob(); job.appendQueryData("ip", ip); job.appendQueryData("version", version); @@ -89,6 +92,9 @@ public static void arthasUsage(String cmd, String detail) { } public static void arthasUsageSuccess(String cmd, List args) { + if (statUrl == null) { + return; + } StringBuilder commandString = new StringBuilder(cmd); for (String arg : args) { commandString.append(" ").append(arg);