}
}
private void buildTransactionReportResult(TransactionReport transactionReport, String ip, String type, String name,
Map<String, String> data) {
Machine transactionMachine = transactionReport.getMachines().get(ip);
if (transactionMachine != null) {
if (StringUtils.isEmpty(name) && StringUtils.isEmpty(type)) {
Collection<TransactionType> types = transactionMachine.getTypes().values();
for (TransactionType transactionType : types) {
String id = transactionType.getId();
data.put(id + TIME, m_format.format(transactionType.getAvg()));
data.put(id + COUNT, String.valueOf(transactionType.getTotalCount()));
data.put(id + FAILURE_COUNT, String.valueOf(transactionType.getFailCount()));
}
} else if (StringUtils.isEmpty(name) && !StringUtils.isEmpty(type)) {
TransactionType transactionType = transactionMachine.findType(type);
if (transactionType != null) {
data.put(TIME, m_format.format(transactionType.getAvg()));
data.put(COUNT, String.valueOf(transactionType.getTotalCount()));
data.put(FAILURE_COUNT, String.valueOf(transactionType.getFailCount()));
for (TransactionName transactionName : transactionType.getNames().values()) {
String id = transactionName.getId();
data.put(id + TIME, m_format.format(transactionName.getAvg()));
data.put(id + COUNT, String.valueOf(transactionName.getTotalCount()));
data.put(id + FAILURE_COUNT, String.valueOf(transactionName.getFailCount()));
}
}
} else if (!StringUtils.isEmpty(name) && !StringUtils.isEmpty(type)) {
TransactionType transactionType = transactionMachine.findType(type);
if (transactionType != null) {
TransactionName transactionName = transactionType.findName(name);
if (transactionName != null) {