public class ExperimentStatus extends Object implements Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
ExperimentStatus.States
Typical states of a benchmark.
|
| Modifier and Type | Field and Description |
|---|---|
private long |
abortionTimeStamp
The timestamp at which the experiment will be aborted by the
abortTimer. |
private Timer |
abortTimer
Timer used to abort the experiment if it takes too much time.
|
private String |
benchmarkContainer
Container name of the system.
|
private boolean |
benchmarkRunning
Flag indicating whether the benchmark is ready.
|
ExperimentConfiguration |
config
Config of the current benchmark.
|
String |
experimentUri
URI of this experiment.
|
private static org.slf4j.Logger |
LOGGER |
private Semaphore |
modelMutex
Mutex to make the access to the model thread safe.
|
private org.apache.jena.rdf.model.Model |
resultModel
The RDF model containing the results.
|
private long |
startTimeStamp
The timestamp in which this status object has been created.
|
private ExperimentStatus.States |
state
State of the benchmark.
|
private String |
systemContainer
Container name of the system.
|
private boolean |
systemRunning
Flag indicating whether the benchmark system is ready.
|
| Constructor and Description |
|---|
ExperimentStatus(ExperimentConfiguration config,
String experimentUri)
Creates an experiment status with the given experiment config, the given
experiment URI and the current system time as start time.
|
ExperimentStatus(ExperimentConfiguration config,
String experimentUri,
ExperimentManager manager,
long timeUntilAborting)
Creates an experiment status with the given experiment config, the given
experiment URI as well as the current system time as start time and starts
the abortion timer using the given maximum runtime of the experiment and the
experiment manager which will be used to abort the experiment if the time is
exceeded.
|
ExperimentStatus(ExperimentConfiguration config,
String experimentUri,
ExperimentManager manager,
long timeUntilAborting,
long startTimeStamp)
Creates an experiment status with the given experiment config, the given
experiment URI as well as the given starting time and starts the abortion
timer using the given maximum runtime of the experiment and the experiment
manager which will be used to abort the experiment if the time is exceeded.
|
ExperimentStatus(ExperimentConfiguration config,
String experimentUri,
long startTimeStamp)
Creates an experiment status with the given experiment config, the given
experiment URI as well as the given starting time and starts the abortion
timer using the given maximum runtime of the experiment and the experiment
manager which will be used to abort the experiment if the time is exceeded.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addBasicInformation_Unsecured()
Adds basic information to the result model.
|
private void |
addError_Unsecured(org.apache.jena.rdf.model.Resource error)
Adds the given error to the result model.
|
void |
addError(org.apache.jena.rdf.model.Resource error)
Adds the given error to the result model.
|
void |
addErrorIfNonPresent(org.apache.jena.rdf.model.Resource error)
Adds the given error to the result model if it does not already contain an
error.
|
void |
addMetaDataToResult(ImageManager imageManager,
long endTimeStamp)
Uses the given
ImageManager instance to add additional meta data
regarding the benchmark and the system to the experiment result model. |
void |
close() |
long |
getAbortionTimeStamp() |
String |
getBenchmarkContainer() |
ExperimentConfiguration |
getConfig() |
org.apache.jena.rdf.model.Model |
getResultModel() |
long |
getStartTimeStamp() |
ExperimentStatus.States |
getState() |
String |
getSystemContainer() |
private void |
initModel_Unsecured()
Initializes the result model and adds basic information using
addBasicInformation_Unsecured(). |
boolean |
isBenchmarkRunning() |
boolean |
isSystemRunning() |
void |
setBenchmarkContainer(String benchmarkContainer) |
void |
setBenchmarkRunning(boolean benchmarkRunning) |
void |
setOrMergeResultModel(org.apache.jena.rdf.model.Model resultModel)
Sets the result model if there is no model present.
|
boolean |
setReadyAndCheck(boolean systemReportedReady)
The method sets a flag that (depending on the given flag) the system or the
benchmark is ready and returns
true if internally both have the
state of being ready. |
void |
setResultModel(org.apache.jena.rdf.model.Model resultModel)
Sets the result model.
|
void |
setState(ExperimentStatus.States state) |
void |
setSystemContainer(String systemContainer) |
void |
setSystemRunning(boolean systemRunning) |
void |
startAbortionTimer(ExperimentManager manager,
long timeUntilAborting)
Starts the abortion timer using the given maximum runtime of the experiment
and the experiment manager which will be used to abort the experiment if the
time is exceeded.
|
private static final org.slf4j.Logger LOGGER
public final ExperimentConfiguration config
public final String experimentUri
private final long startTimeStamp
private long abortionTimeStamp
abortTimer.private ExperimentStatus.States state
private boolean benchmarkRunning
private boolean systemRunning
private String benchmarkContainer
private String systemContainer
private org.apache.jena.rdf.model.Model resultModel
private Semaphore modelMutex
private final Timer abortTimer
public ExperimentStatus(ExperimentConfiguration config, String experimentUri)
config - the configuration of the experimentexperimentUri - the URI of the experimentpublic ExperimentStatus(ExperimentConfiguration config, String experimentUri, long startTimeStamp)
config - the configuration of the experimentexperimentUri - the URI of the experimentstartTimeStamp - the time stamp at which the experiment is started.public ExperimentStatus(ExperimentConfiguration config, String experimentUri, ExperimentManager manager, long timeUntilAborting)
config - the configuration of the experimentexperimentUri - the URI of the experimentmanager - experiment manager which is used if the maximum runtime is
exceededtimeUntilAborting - the maximum runtime for this experiment which is used to configure
the internal timer.public ExperimentStatus(ExperimentConfiguration config, String experimentUri, ExperimentManager manager, long timeUntilAborting, long startTimeStamp)
config - the configuration of the experimentexperimentUri - the URI of the experimentmanager - experiment manager which is used if the maximum runtime is
exceededtimeUntilAborting - the maximum runtime for this experiment which is used to configure
the internal timer.startTimeStamp - the time stamp at which the experiment is started.public ExperimentStatus.States getState()
public void setState(ExperimentStatus.States state)
public ExperimentConfiguration getConfig()
public boolean isBenchmarkRunning()
public void setBenchmarkRunning(boolean benchmarkRunning)
public boolean isSystemRunning()
public void setSystemRunning(boolean systemRunning)
public String getBenchmarkContainer()
public void setBenchmarkContainer(String benchmarkContainer)
public String getSystemContainer()
public void setSystemContainer(String systemContainer)
public long getStartTimeStamp()
public long getAbortionTimeStamp()
public void startAbortionTimer(ExperimentManager manager, long timeUntilAborting)
manager - experiment manager which is used if the maximum runtime is
exceededtimeUntilAborting - the maximum runtime for this experiment which is used to configure
the internal timer.public boolean setReadyAndCheck(boolean systemReportedReady)
true if internally both have the
state of being ready.systemReportedReady - true if the system is ready or false if
the benchmark is readytrue if system and benchmark are readypublic org.apache.jena.rdf.model.Model getResultModel()
public void setOrMergeResultModel(org.apache.jena.rdf.model.Model resultModel)
This method is thread-safe.
resultModel - the new result modelpublic void setResultModel(org.apache.jena.rdf.model.Model resultModel)
This method is thread-safe.
resultModel - the new result modelpublic void addErrorIfNonPresent(org.apache.jena.rdf.model.Resource error)
This method is thread-safe.
error - the error that should be added to the result modelpublic void addError(org.apache.jena.rdf.model.Resource error)
This method is thread-safe.
error - the error that should be added to the result modelprivate void addError_Unsecured(org.apache.jena.rdf.model.Resource error)
This method is not thread-safe.
error - the error that should be added to the result modelprivate void initModel_Unsecured()
addBasicInformation_Unsecured().
This method is not thread-safe.
private void addBasicInformation_Unsecured()
This method is not thread-safe.
public void addMetaDataToResult(ImageManager imageManager, long endTimeStamp)
ImageManager instance to add additional meta data
regarding the benchmark and the system to the experiment result model.imageManager - used to get RDF models for the benchmark and the system of this
experimentendTimeStamp - point in time at which the experiment endedpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2017–2018. All rights reserved.