Skip to content

Commit

Permalink
[ISSUE alibaba#12282]Fix the issue where monitoring data cannot be fo…
Browse files Browse the repository at this point in the history
…und through the IP dimension in the ListeningQuery
  • Loading branch information
HMYDK committed Jul 5, 2024
1 parent 9716243 commit 1015c69
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ private List<SampleResult> runConfigListenerCollectionJob(Map<String, String> pa
return new ClusterListenerJob(params, completionService, memberManager).runJobs();
}

private List<SampleResult> runConfigListenerByIpCollectionJob(Map<String, String> params,
CompletionService<SampleResult> completionService) {
return new ClusterListenerByIpJob(params, completionService, memberManager).runJobs();
}

static class ClusterListenerJob extends ClusterJob<SampleResult> {

static final String URL = Constants.COMMUNICATION_CONTROLLER_PATH + "/configWatchers";
Expand All @@ -93,6 +98,16 @@ static class ClusterListenerJob extends ClusterJob<SampleResult> {
}
}

static class ClusterListenerByIpJob extends ClusterJob<SampleResult> {

static final String URL = Constants.COMMUNICATION_CONTROLLER_PATH + "/watcherConfigs";

ClusterListenerByIpJob(Map<String, String> params, CompletionService<SampleResult> completionService,
ServerMemberManager serverMemberManager) {
super(URL, params, completionService, serverMemberManager);
}
}

private List<ListenerCheckResult> runHasCheckListenerCollectionJob(Map<String, String> params,
CompletionService<ListenerCheckResult> completionService) {
return new ClusterCheckHasListenerJob(params, completionService, memberManager).runJobs();
Expand Down Expand Up @@ -324,7 +339,7 @@ public SampleResult getCollectSampleResultByIp(String ip, int sampleTime) {

SampleResult sampleCollectResult = new SampleResult();
for (int i = 0; i < sampleTime; i++) {
List<SampleResult> sampleResults = runConfigListenerCollectionJob(params, completionService);
List<SampleResult> sampleResults = runConfigListenerByIpCollectionJob(params, completionService);
if (sampleResults != null) {
sampleCollectResult = mergeSampleResult(sampleCollectResult, sampleResults);
}
Expand Down

0 comments on commit 1015c69

Please sign in to comment.