out.print("</ul></div>\n");
}
private void writeOverallMetrics(Map<String, DataPair> sizes,
Map<String, DataPair> timeInPhase, Map<String, String> phaseTypes) {
DataPair totalTime = timeInPhase.get(TOTAL_KEY);
out.print("<h2>");
out.print(res("Overall_Metrics"));
out.print("</h2>\n<table>\n");
printTableHeader(null, false);
// print numbers for productivity
for (Entry<String, DataPair> e : sizes.entrySet()) {
String metric = e.getKey();
String label = resources.format("Productivity_Units_FMT", metric);
DataPair productivity = new DataPair(e.getValue()).multiply(60)
.divide(totalTime);
printTableRow(label, productivity, Format.Number);
}
// print total time
printTableRow(res("Total_Time"), totalTime, Format.Time);
// print time estimating error
DataPair timeEst = new DataPair();
timeEst.actual = (totalTime.actual - totalTime.plan) / totalTime.plan;
printTableRow(res("Time_Estimating_Error"), timeEst, Format.Percent,
true, 0);
// print CPI
DataPair cpi = new DataPair();
cpi.actual = totalTime.plan / totalTime.actual;
printTableRow(res("CPI"), cpi, Format.Number, true, 0);
// calculate cost of quality
DataPair appraisalCOQ = new DataPair();
DataPair failureCOQ = new DataPair();
for (Entry<String, DataPair> e : timeInPhase.entrySet()) {
String phaseName = e.getKey();
String phaseType = phaseTypes.get(phaseName);
if ("Appraisal".equals(phaseType))
appraisalCOQ.add(e.getValue());
else if ("Failure".equals(phaseType))
failureCOQ.add(e.getValue());
}
appraisalCOQ.divide(totalTime);
failureCOQ.divide(totalTime);
DataPair totalCOQ = new DataPair(appraisalCOQ).add(failureCOQ);
DataPair afr = new DataPair(appraisalCOQ).divide(failureCOQ);
printTableRow(res("%_Appraisal_COQ"), appraisalCOQ, Format.Percent);
printTableRow(res("%_Failure_COQ"), failureCOQ, Format.Percent);
printTableRow(res("%_Total_COQ"), totalCOQ, Format.Percent);
printTableRow(res("Appraisal_to_Failure_Ratio"), afr, Format.Number);