use of net.sourceforge.processdash.util.DataPair in project processdash by dtuma.
the class WorkflowHistDataHelper method cum.
private Map<String, DataPair> cum(Map<String, DataPair> phaseData) {
Map<String, DataPair> result = new LinkedHashMap<String, DataPair>();
DataPair cum = new DataPair();
for (Entry<String, DataPair> e : phaseData.entrySet()) {
cum.add(e.getValue());
result.put(e.getKey(), new DataPair(cum));
}
result.remove(TOTAL_PHASE_KEY);
return result;
}
use of net.sourceforge.processdash.util.DataPair in project processdash by dtuma.
the class WorkflowHistDataHelper method getTotalTimeInPhase.
public Map<String, DataPair> getTotalTimeInPhase() {
Map<String, DataPair> result = new LinkedHashMap();
List<String> stepNames = QueryUtils.pluckColumn(getPhaseData(), PhaseCol.PhaseName);
for (String step : stepNames) result.put(step, new DataPair());
for (Object[] row : getTimeInPhaseData()) {
String stepName = get(row, TimeCol.PhaseName);
DataPair dataPair = result.get(stepName);
if (dataPair == null) {
stepName = "(" + stepName + ")";
dataPair = new DataPair();
result.put(stepName, dataPair);
}
dataPair.plan += ((Number) get(row, TimeCol.PlanTime)).doubleValue();
dataPair.actual += ((Number) get(row, TimeCol.ActTime)).doubleValue();
}
DataPair total = new DataPair();
for (DataPair phasePair : result.values()) total.add(phasePair);
result.put(TOTAL_PHASE_KEY, total);
return result;
}
use of net.sourceforge.processdash.util.DataPair in project processdash by dtuma.
the class WorkflowHistDataHelper method getAddedAndModifiedSizes.
public Map<String, DataPair> getAddedAndModifiedSizes() {
Map<String, DataPair> result = new TreeMap();
for (Object[] row : getSizeData()) {
String sizeUnits = get(row, SizeCol.Units);
String measurementType = get(row, SizeCol.MType);
double sizeValue = ((Number) get(row, SizeCol.Size)).doubleValue();
DataPair dataPair = result.get(sizeUnits);
if (dataPair == null)
result.put(sizeUnits, dataPair = new DataPair());
if ("Plan".equals(measurementType))
dataPair.plan += sizeValue;
else if ("Actual".equals(measurementType))
dataPair.actual += sizeValue;
}
return result;
}
use of net.sourceforge.processdash.util.DataPair in project processdash by dtuma.
the class WorkflowHistDataHelper method getDefectsByPhase.
private Map<String, DataPair>[] getDefectsByPhase(Enactment e) {
List<String> stepNames = QueryUtils.pluckColumn(getPhaseData(), PhaseCol.PhaseName);
Map<String, DataPair>[] result = new Map[3];
result[INJ] = new LinkedHashMap<String, DataPair>();
result[REM] = new LinkedHashMap<String, DataPair>();
result[INJ].put(Defect.BEFORE_DEVELOPMENT, new DataPair());
for (String step : stepNames) {
result[INJ].put(step, new DataPair());
result[REM].put(step, new DataPair());
}
result[REM].put(Defect.AFTER_DEVELOPMENT, new DataPair());
DataPair unrecognized = new DataPair();
result[UNK] = Collections.singletonMap(TOTAL_PHASE_KEY, unrecognized);
DataPair total = new DataPair();
result[INJ].put(TOTAL_PHASE_KEY, total);
result[REM].put(TOTAL_PHASE_KEY, total);
addDefectData(result, unrecognized, total, e);
return result;
}
use of net.sourceforge.processdash.util.DataPair in project processdash by dtuma.
the class WorkflowPlanSummary method printTable.
private void printTable(String titleRes, String subtitleRes, Map<String, DataPair> data, Format fmt, boolean showActualPercent) {
if (data.isEmpty())
return;
double percentOf = 0;
if (showActualPercent) {
DataPair d = data.get(TOTAL_KEY);
if (d != null)
percentOf = d.actual;
}
showActualPercent = percentOf > 0;
out.print("<h2>" + esc(res(titleRes)) + "</h2>\n");
out.print("<table>\n");
printTableHeader(subtitleRes, showActualPercent);
for (Entry<String, DataPair> e : data.entrySet()) {
printTableRow(e.getKey(), e.getValue(), fmt, false, percentOf);
}
out.print("</table>\n");
}
Aggregations