net.sf.sparql.benchmarking.monitoring
Class CsvProgressListener

java.lang.Object
  extended by net.sf.sparql.benchmarking.monitoring.CsvProgressListener
All Implemented Interfaces:
ProgressListener

public class CsvProgressListener
extends Object
implements ProgressListener

A Progress Listener that generates a CSV output file

Author:
rvesse

Constructor Summary
CsvProgressListener(String file)
          Creates a new CSV progress listener which writes to the given file provided it does not already exist
CsvProgressListener(String file, boolean allowOverwrite)
          Creates a new CSV progress listener which writes to the given file optionally overwriting it if it exists
 
Method Summary
<T extends Options>
void
afterOperation(Runner<T> runner, T options, Operation operation, OperationRun run)
          Does nothing as this listener discards individual operation run statistics
<T extends Options>
void
afterOperationMix(Runner<T> runner, T options, OperationMix mix, OperationMixRun run)
          Handles the Mix progress event by recording the run statistics for later printing to the CSV file
<T extends Options>
void
beforeOperation(Runner<T> runner, T options, Operation operation)
          Does nothing as this listener discards individual operation run statistics
<T extends Options>
void
beforeOperationMix(Runner<T> runner, T options, OperationMix mix)
          Invoked before each run of an operation mix
<T extends Options>
void
finish(Runner<T> runner, T options, boolean ok)
          Handles the finished event by printing relevant statistics to the CSV file
<T extends Options>
void
progress(Runner<T> runner, T options, String message)
          Does nothing as this listener discards informational messages
<T extends Options>
void
start(Runner<T> runner, T options)
          Handles the started event by preparing a record of the run configuration which will eventually be printed to the CSV file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CsvProgressListener

public CsvProgressListener(String file)
Creates a new CSV progress listener which writes to the given file provided it does not already exist

Parameters:
file - File

CsvProgressListener

public CsvProgressListener(String file,
                           boolean allowOverwrite)
Creates a new CSV progress listener which writes to the given file optionally overwriting it if it exists

Parameters:
file - File
allowOverwrite - Whether to allow overwrites
Method Detail

start

public <T extends Options> void start(Runner<T> runner,
                                      T options)
Handles the started event by preparing a record of the run configuration which will eventually be printed to the CSV file

Specified by:
start in interface ProgressListener
Parameters:
runner - Runner
options - Options

finish

public <T extends Options> void finish(Runner<T> runner,
                                       T options,
                                       boolean ok)
Handles the finished event by printing relevant statistics to the CSV file

Specified by:
finish in interface ProgressListener
Parameters:
ok - Whether benchmarking finished OK
runner - Runner
options - Options

progress

public <T extends Options> void progress(Runner<T> runner,
                                         T options,
                                         String message)
Does nothing as this listener discards informational messages

Specified by:
progress in interface ProgressListener
Parameters:
message - Informational Message
runner - Runner
options - Options

beforeOperation

public <T extends Options> void beforeOperation(Runner<T> runner,
                                                T options,
                                                Operation operation)
Does nothing as this listener discards individual operation run statistics

Specified by:
beforeOperation in interface ProgressListener
Parameters:
operation - Benchmark Operation
runner - Runner
options - Options

afterOperation

public <T extends Options> void afterOperation(Runner<T> runner,
                                               T options,
                                               Operation operation,
                                               OperationRun run)
Does nothing as this listener discards individual operation run statistics

Specified by:
afterOperation in interface ProgressListener
Parameters:
operation - Benchmark Operation
run - Operation Run statistics
runner - Runner
options - Options

beforeOperationMix

public <T extends Options> void beforeOperationMix(Runner<T> runner,
                                                   T options,
                                                   OperationMix mix)
Description copied from interface: ProgressListener
Invoked before each run of an operation mix

Specified by:
beforeOperationMix in interface ProgressListener
Parameters:
runner - Runner
options - Options
mix - Operation Mix

afterOperationMix

public <T extends Options> void afterOperationMix(Runner<T> runner,
                                                  T options,
                                                  OperationMix mix,
                                                  OperationMixRun run)
Handles the Mix progress event by recording the run statistics for later printing to the CSV file

Specified by:
afterOperationMix in interface ProgressListener
Parameters:
runner - Runner
options - Options
mix - Operation mix
run - Mix run information


Copyright © 2014. All Rights Reserved.