|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.basher.impl.AbstractCollector
net.sourceforge.basher.impl.AbstractFileCollector
public abstract class AbstractFileCollector
| Nested Class Summary | |
|---|---|
static class |
AbstractFileCollector.Classifier
|
class |
AbstractFileCollector.FileEntry
|
static class |
AbstractFileCollector.Type
|
| Field Summary | |
|---|---|
protected java.lang.String |
_collectionDirectory
|
protected java.util.Map<java.lang.String,net.sourceforge.basher.impl.AbstractFileCollector.OpenFile> |
_openFiles
|
protected java.io.File |
_parent
|
| Fields inherited from class net.sourceforge.basher.impl.AbstractCollector |
|---|
_log, _timeSource |
| Constructor Summary | |
|---|---|
AbstractFileCollector()
|
|
| Method Summary | |
|---|---|
protected void |
closeOpenResources()
|
protected void |
dumpAverage(Average average)
Writes the specified Average to the averag file. |
void |
fail(TaskExecutionContext taskExecutionContext,
long elapsedTime,
long elapsedTimeNanos,
java.lang.Throwable throwable)
Writes the result of a failed task to the failure file. |
protected abstract java.lang.String |
formatAverage(Average average)
|
protected abstract java.lang.String |
formatExecution(java.lang.String taskName,
long elapsedTime,
long elapsedTimeNanos)
|
protected java.io.BufferedWriter |
getWriter(java.lang.String fileKey,
AbstractFileCollector.Classifier classifier,
java.lang.Object... headerParams)
Retrieves (and possibly creates) a new writer on to which to write data |
protected void |
initializeCollector(BasherContext basherContext)
|
void |
initializeService()
Initializes the service. |
Average |
markAverage()
Ensures the average over the last time slice is written to disk. |
void |
notRun(TaskExecutionContext taskExecutionContext,
long elapsedTime,
long elapsedTimeNanos)
Writes the result of a not tun task execution to the notrun file. |
void |
setAverageFilenamePrefix(java.lang.String averageFilenamePrefix)
|
void |
setAverageFooter(java.lang.String averageFooter)
|
void |
setAverageHeader(java.lang.String averageHeader)
|
void |
setExecutionFooter(java.lang.String executionFooter)
|
void |
setExecutionHeader(java.lang.String executionHeader)
|
void |
setExtension(java.lang.String extension)
|
void |
setNumThreads(int numThreads)
|
void |
setQueueCapacity(int queueCapacity)
|
void |
setTimeOut(long timeOut)
|
void |
success(TaskExecutionContext taskExecutionContext,
long elapsedTime,
long elapsedTimeNanos)
Writes the result of a successful task execution to the success file. |
protected void |
writeToFile(AbstractFileCollector.Type type,
java.lang.String taskName,
long elapsedTime,
long elapsedTimeNanos)
Writes the time the specified task took to execute. |
| 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 |
| Field Detail |
|---|
protected final java.util.Map<java.lang.String,net.sourceforge.basher.impl.AbstractFileCollector.OpenFile> _openFiles
protected java.io.File _parent
protected java.lang.String _collectionDirectory
| Constructor Detail |
|---|
public AbstractFileCollector()
| Method Detail |
|---|
public void setNumThreads(int numThreads)
public void setTimeOut(long timeOut)
public void setQueueCapacity(int queueCapacity)
public void setAverageFooter(java.lang.String averageFooter)
public void setExecutionFooter(java.lang.String executionFooter)
public void setAverageHeader(java.lang.String averageHeader)
public void setExecutionHeader(java.lang.String executionHeader)
public void setExtension(java.lang.String extension)
public void setAverageFilenamePrefix(java.lang.String averageFilenamePrefix)
public void initializeService()
throws java.lang.Exception
java.lang.Exception - If the script directory does not exist or can not be written to
public void success(TaskExecutionContext taskExecutionContext,
long elapsedTime,
long elapsedTimeNanos)
success in interface Collectorsuccess in class AbstractCollectortaskExecutionContext - The task execution context wrapping the executed task.elapsedTime - Time of executionelapsedTimeNanos -
public void fail(TaskExecutionContext taskExecutionContext,
long elapsedTime,
long elapsedTimeNanos,
java.lang.Throwable throwable)
fail in interface Collectorfail in class AbstractCollectortaskExecutionContext - The task execution context wrapping the task that failed.elapsedTime - Time of executionelapsedTimeNanos - throwable - The reason (if specified) for the failureprotected void closeOpenResources()
closeOpenResources in class AbstractCollector
protected void initializeCollector(BasherContext basherContext)
throws java.lang.Exception
initializeCollector in class AbstractCollectorjava.lang.Exception
public void notRun(TaskExecutionContext taskExecutionContext,
long elapsedTime,
long elapsedTimeNanos)
notRun in interface CollectornotRun in class AbstractCollectortaskExecutionContext - The task that didn't run.elapsedTime - Time of executionelapsedTimeNanos - protected void dumpAverage(Average average)
Average to the averag file.
average - The average to write to diskprotected abstract java.lang.String formatAverage(Average average)
protected abstract java.lang.String formatExecution(java.lang.String taskName,
long elapsedTime,
long elapsedTimeNanos)
protected void writeToFile(AbstractFileCollector.Type type,
java.lang.String taskName,
long elapsedTime,
long elapsedTimeNanos)
type - taskName - The name of the task (used for the filename as well)elapsedTime - Time the task took to executeelapsedTimeNanos - public Average markAverage()
markAverage in interface CollectormarkAverage in class AbstractCollector
protected java.io.BufferedWriter getWriter(java.lang.String fileKey,
AbstractFileCollector.Classifier classifier,
java.lang.Object... headerParams)
throws java.io.IOException
fileKey - The identifier of the bufferclassifier -
java.io.IOException - If the retrieval (create) fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||