Skip to content

Commit

Permalink
[INLONG-10751][Agent] Report Agent process status for backend problem…
Browse files Browse the repository at this point in the history
… analysis
  • Loading branch information
justinwwhuang committed Aug 5, 2024
1 parent 6bad6ba commit 472ac8d
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class AgentStatusManager {
public static final String INLONG_AGENT_SYSTEM = "inlong_agent_system";
public static final String INLONG_AGENT_STATUS = "inlong_agent_status";

private static AgentStatusManager heartbeatManager = null;
private static AgentStatusManager manager = null;
private final AgentConfiguration conf;
private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 设置格式
private Runtime runtime = Runtime.getRuntime();
Expand All @@ -94,21 +94,21 @@ private AgentStatusManager(AgentManager agentManager) {
}

public static AgentStatusManager getInstance(AgentManager agentManager) {
if (heartbeatManager == null) {
if (manager == null) {
synchronized (AgentStatusManager.class) {
if (heartbeatManager == null) {
heartbeatManager = new AgentStatusManager(agentManager);
if (manager == null) {
manager = new AgentStatusManager(agentManager);
}
}
}
return heartbeatManager;
return manager;
}

public static AgentStatusManager getInstance() {
if (heartbeatManager == null) {
if (manager == null) {
throw new RuntimeException("HeartbeatManager has not been initialized by agentManager");
}
return heartbeatManager;
return manager;
}

public void sendStatusMsg(List<String> fields) {
Expand Down

0 comments on commit 472ac8d

Please sign in to comment.