use of net.sourceforge.processdash.log.time.DashboardTimeLog in project processdash by dtuma.
the class DashController method startTimingImpl.
private static void startTimingImpl() {
DashboardTimeLog tl = (DashboardTimeLog) dash.getTimeLog();
tl.getTimeLoggingModel().startTiming();
}
use of net.sourceforge.processdash.log.time.DashboardTimeLog in project processdash by dtuma.
the class DashController method stopTimingImpl.
private static void stopTimingImpl() {
DashboardTimeLog tl = (DashboardTimeLog) dash.getTimeLog();
tl.getTimeLoggingModel().stopTiming();
}
use of net.sourceforge.processdash.log.time.DashboardTimeLog in project processdash by dtuma.
the class TaskStatusApi method getTargetPath.
/** Retrieve the target path from the incoming HTTP request */
private String getTargetPath() {
// use the prefix, if one was supplied in the request
String result = getPrefix();
// selected task
if (!StringUtils.hasValue(result)) {
DashboardContext ctx = getDashboardContext();
DashboardTimeLog tl = (DashboardTimeLog) ctx.getTimeLog();
TimeLoggingModel tlm = tl.getTimeLoggingModel();
result = tlm.getActiveTaskModel().getPath();
}
// verify that the named path exists and is a leaf task
DashHierarchy hier = getPSPProperties();
PropertyKey key = hier.findExistingKey(result);
if (key == null)
throw new WebApiException("no-such-task", 404, "The task '" + result + "' was not found.");
else if (hier.getNumChildren(key) != 0)
throw new WebApiException("not-leaf-task", 400, "The item '" + result + "' is not a leaf task.");
return result;
}
use of net.sourceforge.processdash.log.time.DashboardTimeLog in project processdash by dtuma.
the class SizeMetricApiDispatcher method getTargetPath.
/** Retrieve the target path from the incoming HTTP request */
private String getTargetPath() {
// use the prefix, if one was supplied in the request
String result = getPrefix();
// selected task
if (!StringUtils.hasValue(result)) {
DashboardContext ctx = getDashboardContext();
DashboardTimeLog tl = (DashboardTimeLog) ctx.getTimeLog();
TimeLoggingModel tlm = tl.getTimeLoggingModel();
result = tlm.getActiveTaskModel().getPath();
}
return result;
}
use of net.sourceforge.processdash.log.time.DashboardTimeLog in project processdash by dtuma.
the class DisplayState method writeTimingState.
private void writeTimingState() {
DashboardContext ctx = getDashboardContext();
DashboardTimeLog tl = (DashboardTimeLog) ctx.getTimeLog();
TimeLoggingModel tlm = tl.getTimeLoggingModel();
String path = tlm.getActiveTaskModel().getPath();
String isTiming = tlm.isPaused() ? "false" : "true";
out.write("Content-Type: text/plain\r\n\r\n");
out.write("activeTask=" + path + "\r\n");
out.write("isTiming=" + isTiming + "\r\n");
out.flush();
}
Aggregations