private static CollectorResult doGetCollectorTree(InternalProfileCollector collector) { List<CollectorResult> childResults = new ArrayList<>(collector.children.size()); for (InternalProfileCollector child : collector.children) { CollectorResult result = doGetCollectorTree(child); childResults.add(result); } return new CollectorResult( collector.getName(), collector.getReason(), collector.getTime(), childResults); }
public CollectorResult getCollectorTree() { return InternalProfileCollector.doGetCollectorTree(this); }