}
private List<TreeNode> getDataRec(Map<String, AMinMaxAvgData> map, long parentSelfNanos, double parentTotalNanos, int numParentCalls) {
final List<TreeNode> result = new ArrayList<TreeNode>();
for(Map.Entry<String, AMinMaxAvgData> entry: getSorted(map, parentSelfNanos, numParentCalls)) {
final AMinMaxAvgData inputData = entry.getValue();
double fractionOfParent = inputData.getTotalNanos() / parentTotalNanos;
long selfNanos = inputData.getTotalNanos();
for(AMinMaxAvgData childData: inputData.getChildren().values()) {
if(childData.isSerial()) {
selfNanos -= childData.getTotalNanos();
}
}
final long[] dataRaw = new long[] {
(long)(100 * 10 * fractionOfParent),
(long)(100 * inputData.getTotalNumInContext() / numParentCalls),
inputData.getTotalNanos() / MILLION,
inputData.getAvgNanos() / MILLION,
inputData.getMinNanos() / MILLION,
inputData.getMaxNanos() / MILLION
};
result.add(new TreeNode(entry.getKey(), inputData.isSerial(), dataRaw, getDataRec(inputData.getChildren(), selfNanos, inputData.getTotalNanos(), inputData.getTotalNumInContext())));
}
return result;
}