提交 a9850c13 编写于 作者: P peng-yongsheng

Report @ 2018/03/04 23:00, Application, [COLLECTOR] The topology is incorrect.

Fixed the getApplicationTopology bug, remove the application node which not contains the source or target of calls.
上级 c587b9f0
......@@ -82,6 +82,20 @@ public class ApplicationTopologyService {
TopologyBuilder builder = new TopologyBuilder(moduleManager);
return builder.build(applicationComponents, applicationMappings, applicationMetrics, callerReferenceMetric, calleeReferenceMetric, step, startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket);
Topology topology = builder.build(applicationComponents, applicationMappings, applicationMetrics, callerReferenceMetric, calleeReferenceMetric, step, startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket);
Set<Integer> nodeIds = new HashSet<>();
topology.getCalls().forEach(call -> {
nodeIds.add(call.getSource());
nodeIds.add(call.getTarget());
});
for (int i = topology.getNodes().size() - 1; i >= 0; i--) {
if (!nodeIds.contains(topology.getNodes().get(i).getId())) {
topology.getNodes().remove(i);
}
}
return topology;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册