Package org.hippoecm.hst.diagnosis
Class TaskLogFormatUtils
- java.lang.Object
-
- org.hippoecm.hst.diagnosis.TaskLogFormatUtils
-
public class TaskLogFormatUtils extends Object
Utility class to get a pretty printed hierarchical task log.
-
-
Constructor Summary
Constructors Constructor Description TaskLogFormatUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getTaskLog(Task task)
Returns a nicely formatted string showing all the tasks hierarchically.static String
getTaskLog(Task task, int maxDepth)
Returns a formatted string from thetask
including its descendant tasks.static String
getTaskLog(Task task, int maxDepth, long subtaskThresholdMillisec)
Returns a formatted string from thetask
including its descendant tasks.
-
-
-
Method Detail
-
getTaskLog
public static String getTaskLog(Task task)
Returns a nicely formatted string showing all the tasks hierarchically.- Returns:
- returns the
task
nicely hierarchical formatted
-
getTaskLog
public static String getTaskLog(Task task, int maxDepth)
Returns a formatted string from thetask
including its descendant tasks. The log should include descendant tasks only inmaxDepth
level at max. WhenmaxDepth
is set to a negative value, all the descendant tasks will be included.- Parameters:
task
- the task to logmaxDepth
- the maximum depth until how deep child tasks should be logged. A negativemaxDepth
value will log all descendant tasks,maxDepth
of0
only the rootTask,maxDepth
of1
the rootTask plus its direct children, etc.- Returns:
-
getTaskLog
public static String getTaskLog(Task task, int maxDepth, long subtaskThresholdMillisec)
Returns a formatted string from thetask
including its descendant tasks. The log should include descendant tasks only inmaxDepth
level at max. WhenmaxDepth
is set to a negative value, all the descendant tasks will be included. Also, the log should include descendant tasks only a descendant task takes more time thansubtaskThresholdMillisec
in milliseconds. WhensubtaskThresholdMillisec
is set to a non-negative value, only descendant tasks which take not less time thantaskThresholdMillisec
will be included.- Parameters:
task
- the task to logmaxDepth
- the maximum depth until how deep child tasks should be logged. A negativemaxDepth
value will log all descendant tasks,maxDepth
of0
only the rootTask,maxDepth
of1
the rootTask plus its direct children, etc.subtaskThresholdMillisec
- the threshold time milliseconds to include logs of subtasks undertask
.- Returns:
-
-