rabbit.nio
Class StatisticsHolder

java.lang.Object
  extended by rabbit.nio.StatisticsHolder

public class StatisticsHolder
extends Object

A holder of statistics for tasks.

Author:
Robert Olofsson

Constructor Summary
StatisticsHolder()
           
 
Method Summary
 void addPendingTask(TaskIdentifier ti)
          A new task is put in the queue, waiting to be handled.
 void changeTaskStatusToFinished(TaskIdentifier ti, boolean wasOk, long timeSpent)
          A task has been completed.
 void changeTaskStatusToRunning(TaskIdentifier ti)
          A pending task is about to be run.
 Map<String,List<CompletionEntry>> getLatest()
          Get information about the most recent completed tasks
 Map<String,List<CompletionEntry>> getLongest()
          Get information about the longest running task.
 Map<String,List<TaskIdentifier>> getPendingTasks()
          Get information about the currently pending tasks.
 Map<String,List<TaskIdentifier>> getRunningTasks()
          Get information about the currently running tasks.
 Map<String,TotalTimeSpent> getTotalTimeSpent()
          Get the total time spent for each task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatisticsHolder

public StatisticsHolder()
Method Detail

addPendingTask

public void addPendingTask(TaskIdentifier ti)
A new task is put in the queue, waiting to be handled.

Parameters:
ti - the identifier of the new task.

changeTaskStatusToRunning

public void changeTaskStatusToRunning(TaskIdentifier ti)
A pending task is about to be run.

Parameters:
ti - the identifier of the task that will start to run.

changeTaskStatusToFinished

public void changeTaskStatusToFinished(TaskIdentifier ti,
                                       boolean wasOk,
                                       long timeSpent)
A task has been completed.

Parameters:
ti - the identifier of the task that has completed.
wasOk - true if the task completed without errors, false otherwise.
timeSpent - wall clock time spent on the task.

getPendingTasks

public Map<String,List<TaskIdentifier>> getPendingTasks()
Get information about the currently pending tasks.


getRunningTasks

public Map<String,List<TaskIdentifier>> getRunningTasks()
Get information about the currently running tasks.


getLatest

public Map<String,List<CompletionEntry>> getLatest()
Get information about the most recent completed tasks


getLongest

public Map<String,List<CompletionEntry>> getLongest()
Get information about the longest running task.


getTotalTimeSpent

public Map<String,TotalTimeSpent> getTotalTimeSpent()
Get the total time spent for each task.