net.sourceforge.basher.impl
Class StdOutCollector

java.lang.Object
  extended by net.sourceforge.basher.impl.AbstractCollector
      extended by net.sourceforge.basher.impl.StdOutCollector
All Implemented Interfaces:
EventListener, Collector, BasherEventListener, org.ops4j.gaderian.events.RegistryShutdownListener

public class StdOutCollector
extends AbstractCollector
implements Collector

Version:
1.0
Author:
Johan Lindquist

Field Summary
 
Fields inherited from class net.sourceforge.basher.impl.AbstractCollector
_log, _timeSource
 
Constructor Summary
StdOutCollector()
           
 
Method Summary
protected  void closeOpenResources()
           
 void fail(TaskExecutionContext taskExecutionContext, long elapsedTime, long elapsedTimeNanos, Throwable throwable)
          Reports a task's failure to run together with the time time elapsed for the failure.
protected  void initializeCollector(BasherContext basherContext)
           
 Average markAverage()
          Informs the collector that a collection period has finished.
 void notRun(TaskExecutionContext taskExecutionContext, long elapsedTime, long elapsedTimeNanos)
          Reports a task's wish to not run altogether with the time time elapsed for it to determine this.
 void success(TaskExecutionContext taskExecutionContext, long elapsedTime, long elapsedTimeNanos)
          Reports a task's successful invocation together with the time elapsed for the task to run.
 
Methods inherited from class net.sourceforge.basher.impl.AbstractCollector
basherEvent, getAverages, getFailures, getNotRun, getSuccesses, getTotal, isCollecting, registryDidShutdown, setLog, setTimeSource, startCollecting, stopCollecting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.basher.Collector
getAverages, getFailures, getNotRun, getSuccesses, getTotal, isCollecting, startCollecting, stopCollecting
 

Constructor Detail

StdOutCollector

public StdOutCollector()
Method Detail

initializeCollector

protected void initializeCollector(BasherContext basherContext)
                            throws Exception
Specified by:
initializeCollector in class AbstractCollector
Throws:
Exception

closeOpenResources

protected void closeOpenResources()
Specified by:
closeOpenResources in class AbstractCollector

success

public void success(TaskExecutionContext taskExecutionContext,
                    long elapsedTime,
                    long elapsedTimeNanos)
Description copied from interface: Collector
Reports a task's successful invocation together with the time elapsed for the task to run.

Specified by:
success in interface Collector
Overrides:
success in class AbstractCollector
Parameters:
taskExecutionContext - The task execution context wrapping the Task that was invoked
elapsedTime - The time it took for the task to run

notRun

public void notRun(TaskExecutionContext taskExecutionContext,
                   long elapsedTime,
                   long elapsedTimeNanos)
Description copied from interface: Collector
Reports a task's wish to not run altogether with the time time elapsed for it to determine this.

Specified by:
notRun in interface Collector
Overrides:
notRun in class AbstractCollector
Parameters:
taskExecutionContext - The task execution context wrapping the Task that didn't wish to run
elapsedTime - The time it took for the task to run and determine it didn't want to run

fail

public void fail(TaskExecutionContext taskExecutionContext,
                 long elapsedTime,
                 long elapsedTimeNanos,
                 Throwable throwable)
Description copied from interface: Collector
Reports a task's failure to run together with the time time elapsed for the failure. The (possible) cause of the failure is also provided.

Specified by:
fail in interface Collector
Overrides:
fail in class AbstractCollector
Parameters:
taskExecutionContext - The task execution context wrapping the Task that failed
elapsedTime - The time it took for the task to run and fail.
throwable - The cause of the failure. This may be null if the cause of the failure is not an exception.

markAverage

public Average markAverage()
Description copied from interface: Collector
Informs the collector that a collection period has finished.

Specified by:
markAverage in interface Collector
Overrides:
markAverage in class AbstractCollector


Copyright © 2006-2010 Basher Team. All Rights Reserved.