use of net.sourceforge.processdash.log.time.TimeLogEntry in project processdash by dtuma.
the class TimeLogEditor method getTimes.
private SortedMap getTimes(Date fd, Date td) {
SortedMap result = new TreeMap();
try {
for (Iterator i = timeLog.filter(null, fd, td); i.hasNext(); ) {
TimeLogEntry tle = (TimeLogEntry) i.next();
String path = tle.getPath();
long[] t = (long[]) result.get(path);
if (t == null) {
t = new long[] { 0L };
result.put(path, t);
}
t[0] += tle.getElapsedTime();
}
} catch (Exception e) {
}
return result;
}
use of net.sourceforge.processdash.log.time.TimeLogEntry in project processdash by dtuma.
the class TimeLogPhaseWaterfallChart method addTimeLogEntries.
private void addTimeLogEntries(ProcessUtil process, Map<String, PhaseSeries> phases, List timeLogEntries, GapSkipTracker gaps, ExceptionSeries exceptions) {
for (Iterator i = timeLogEntries.iterator(); i.hasNext(); ) {
TimeLogEntry tle = (TimeLogEntry) i.next();
addTimeLogEntry(process, phases, tle, gaps, exceptions);
}
}
use of net.sourceforge.processdash.log.time.TimeLogEntry in project processdash by dtuma.
the class TimeLogReport method writeHtml.
/** Write time log data in HTML format */
private void writeHtml(List l) throws IOException {
super.writeHeader();
String path = getPrefix();
String title = For(path);
String owner = For(getOwner());
String header = HEADER_TEXT;
header = resources.interpolate(header, HTMLUtils.ESC_ENTITIES);
header = StringUtils.findAndReplace(header, "%for owner%", owner);
header = StringUtils.findAndReplace(header, "%for path%", title);
header = StringUtils.findAndReplace(header, "%css%", cssLinkHTML());
out.print(header);
if (noPermission) {
interpOut(BLOCKED_BY_PERMISSION);
out.print("</body></html>");
return;
}
interpOut(START_TEXT);
boolean showComments = !parameters.containsKey("hideComments");
if (showComments)
interpOut(COMMENT_HEADER);
out.println("</tr>");
String type = getParameter("type");
ProcessUtil procUtil = null;
if (!"rollup".equals(type) && !"db".equals(type))
procUtil = new ProcessUtil(getDataContext());
for (Iterator rows = l.iterator(); rows.hasNext(); ) {
TimeLogEntry tle = (TimeLogEntry) rows.next();
String entryPath = tle.getPath();
String phase = (procUtil == null ? null : procUtil.getEffectivePhase(entryPath, false));
if (phase == null) {
int slashPos = entryPath.lastIndexOf('/');
phase = entryPath.substring(slashPos + 1);
entryPath = entryPath.substring(0, slashPos);
}
out.println("<TR>");
out.println("<TD>" + HTMLUtils.escapeEntities(entryPath) + "</TD>");
out.println("<TD>" + HTMLUtils.escapeEntities(phase) + "</TD>");
out.println("<TD>" + (tle.getStartTime() == null ? "" : FormatUtil.formatDateTime(tle.getStartTime())) + "</TD>");
out.println("<TD>" + tle.getElapsedTime() + "</TD>");
out.println("<TD>" + tle.getInterruptTime() + "</TD>");
if (showComments) {
String comment = tle.getComment();
out.println("<TD>" + (comment == null ? "" : HTMLUtils.escapeEntities(comment)) + "</TD>");
}
out.println("</TR>");
}
out.println("</TABLE>");
if (!isExporting() && someEntriesBlocked)
interpOut(FILTERED_BY_PERMISSION);
out.println("<!-- cutEnd -->");
if (parameters.get("skipFooter") == null) {
if (!isExportingToExcel())
out.print(resources.interpolate(EXPORT_LINK, HTMLUtils.ESC_ENTITIES));
if (!isExporting() && !"rollup".equals(type) && !"db".equals(type) && !parameters.containsKey("noDisclaimer")) {
StringBuffer html = new StringBuffer(resources.interpolate(DISCLAIMER, HTMLUtils.ESC_ENTITIES));
StringUtils.findAndReplace(html, "<a>", "<a href='../control/showTimeLog'>");
StringUtils.findAndReplace(html, "</a>", "</a>");
out.print(html.toString());
}
}
out.println("</BODY></HTML>");
}
use of net.sourceforge.processdash.log.time.TimeLogEntry in project processdash by dtuma.
the class EVCalculatorData method saveActualPreTime.
private void saveActualPreTime(TimeLog log) throws IOException {
try {
Iterator entries = log.filter(null, null, scheduleStartDate);
while (entries.hasNext()) {
TimeLogEntry entry = (TimeLogEntry) entries.next();
Date d = entry.getStartTime();
if (d == null || d.compareTo(scheduleStartDate) >= 0)
continue;
EVTask task = taskRoot.getTaskForPath(entry.getPath());
if (task != null && !task.isLevelOfEffortTask())
task.actualPreTime += entry.getElapsedTime();
}
} catch (IONoSuchElementException ion) {
throw ion.getIOException();
}
}
Aggregations