org.khelekore.rnio
Interface StatisticsHolder

All Known Implementing Classes:
BasicStatisticsHolder

public interface StatisticsHolder

A holder of statistics for tasks.

Author:
Robert Olofsson

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.
 

Method Detail

addPendingTask

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

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

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

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

Returns:
a mapping from group ids to the task identifiers

getRunningTasks

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

Returns:
a mapping from group ids to the task identifiers

getLatest

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

Returns:
a mapping from group ids to the task identifiers

getLongest

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

Returns:
a mapping from group ids to the task identifiers

getTotalTimeSpent

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

Returns:
a mapping from group ids to the task identifiers