in activemq-tooling/activemq-perf-maven-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/ThroughputReportPlugin.java [70:176]
public Map<String, String> getSummary() {
// Check if tp sampler wasn't used.
if (clientThroughputs.size() == 0) {
return new HashMap<String, String>();
}
long minClientTP = Long.MAX_VALUE; // TP = throughput
long maxClientTP = Long.MIN_VALUE;
long minClientTotalTP = Long.MAX_VALUE;
long maxClientTotalTP = Long.MIN_VALUE;
long systemTotalTP = 0;
double minClientAveTP = Double.MAX_VALUE;
double maxClientAveTP = Double.MIN_VALUE;
double minClientAveEMMTP = Double.MAX_VALUE; // EMM = Excluding Min/Max
double maxClientAveEMMTP = Double.MIN_VALUE;
double systemAveTP = 0.0;
double systemAveEMMTP = 0.0;
String nameMinClientTP = "";
String nameMaxClientTP = "";
String nameMinClientTotalTP = "";
String nameMaxClientTotalTP = "";
String nameMinClientAveTP = "";
String nameMaxClientAveTP = "";
String nameMinClientAveEMMTP = "";
String nameMaxClientAveEMMTP = "";
Set<String> clientNames = clientThroughputs.keySet();
String clientName;
List clientTPList;
long tempLong;
double tempDouble;
int clientCount = 0;
for (Iterator<String> i = clientNames.iterator(); i.hasNext();) {
clientName = i.next();
clientTPList = clientThroughputs.get(clientName);
clientCount++;
tempLong = PerformanceStatisticsUtil.getMin(clientTPList);
if (tempLong < minClientTP) {
minClientTP = tempLong;
nameMinClientTP = clientName;
}
tempLong = PerformanceStatisticsUtil.getMax(clientTPList);
if (tempLong > maxClientTP) {
maxClientTP = tempLong;
nameMaxClientTP = clientName;
}
tempLong = PerformanceStatisticsUtil.getSum(clientTPList);
systemTotalTP += tempLong; // Accumulate total TP
if (tempLong < minClientTotalTP) {
minClientTotalTP = tempLong;
nameMinClientTotalTP = clientName;
}
if (tempLong > maxClientTotalTP) {
maxClientTotalTP = tempLong;
nameMaxClientTotalTP = clientName;
}
tempDouble = PerformanceStatisticsUtil.getAve(clientTPList);
systemAveTP += tempDouble; // Accumulate ave throughput
if (tempDouble < minClientAveTP) {
minClientAveTP = tempDouble;
nameMinClientAveTP = clientName;
}
if (tempDouble > maxClientAveTP) {
maxClientAveTP = tempDouble;
nameMaxClientAveTP = clientName;
}
tempDouble = PerformanceStatisticsUtil.getAveEx(clientTPList);
systemAveEMMTP += tempDouble; // Accumulate ave throughput
// excluding min/max
if (tempDouble < minClientAveEMMTP) {
minClientAveEMMTP = tempDouble;
nameMinClientAveEMMTP = clientName;
}
if (tempDouble > maxClientAveEMMTP) {
maxClientAveEMMTP = tempDouble;
nameMaxClientAveEMMTP = clientName;
}
}
Map<String, String> summary = new HashMap<String, String>();
summary.put(KEY_SYS_TOTAL_TP, String.valueOf(systemTotalTP));
summary.put(KEY_SYS_TOTAL_CLIENTS, String.valueOf(clientCount));
summary.put(KEY_SYS_AVE_TP, String.valueOf(systemAveTP));
summary.put(KEY_SYS_AVE_EMM_TP, String.valueOf(systemAveEMMTP));
summary.put(KEY_SYS_AVE_CLIENT_TP, String.valueOf(systemAveTP / clientCount));
summary.put(KEY_SYS_AVE_CLIENT_EMM_TP, String.valueOf(systemAveEMMTP / clientCount));
summary.put(KEY_MIN_CLIENT_TP, nameMinClientTP + "=" + minClientTP);
summary.put(KEY_MAX_CLIENT_TP, nameMaxClientTP + "=" + maxClientTP);
summary.put(KEY_MIN_CLIENT_TOTAL_TP, nameMinClientTotalTP + "=" + minClientTotalTP);
summary.put(KEY_MAX_CLIENT_TOTAL_TP, nameMaxClientTotalTP + "=" + maxClientTotalTP);
summary.put(KEY_MIN_CLIENT_AVE_TP, nameMinClientAveTP + "=" + minClientAveTP);
summary.put(KEY_MAX_CLIENT_AVE_TP, nameMaxClientAveTP + "=" + maxClientAveTP);
summary.put(KEY_MIN_CLIENT_AVE_EMM_TP, nameMinClientAveEMMTP + "=" + minClientAveEMMTP);
summary.put(KEY_MAX_CLIENT_AVE_EMM_TP, nameMaxClientAveEMMTP + "=" + maxClientAveEMMTP);
return summary;
}