public void dumpAsText(PrintWriter out) {
    long now = EnvironmentEdgeManager.currentTime();

    List<MonitoredTask> tasks = getTasks();
    for (MonitoredTask task : tasks) {
      out.println("Task: " + task.getDescription());
      out.println("Status: " + task.getState() + ":" + task.getStatus());
      long running = (now - task.getStartTime()) / 1000;
      if (task.getCompletionTimestamp() != -1) {
        long completed = (now - task.getCompletionTimestamp()) / 1000;
        out.println("Completed " + completed + "s ago");
        out
          .println("Ran for " + (task.getCompletionTimestamp() - task.getStartTime()) / 1000 + "s");
      } else {
        out.println("Running for " + running + "s");
      }
      out.println();
    }
  }
Create a task filter according to a given filter type.
@param filter type of monitored task
@return a task filter
hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java