WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit ce71c314 authored by Andreas Sewe's avatar Andreas Sewe
Browse files

Added a template method with which to augment the system properties during the...

Added a template method with which to augment the system properties during the actual benchmark iteration.
parent 23b7f214
......@@ -11,6 +11,7 @@ package org.dacapo.harness;
import java.io.*;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.Properties;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
......@@ -124,6 +125,13 @@ public abstract class Benchmark {
/** Saved classloader across iterations */
private ClassLoader savedClassLoader;
/**
* The system properties that were in effect when the harness was started.
*
* @see System#getProperties()
*/
private Properties savedSystemProperties;
/**
* Output stream for validating System.err
*/
......@@ -212,6 +220,8 @@ public abstract class Benchmark {
}
protected void initialize() throws Exception {
savedSystemProperties = System.getProperties();
System.setProperty("java.util.logging.config.file", fileIn(scratch, config.name + ".log"));
synchronized (System.out) {
if (out == null) {
......@@ -299,6 +309,11 @@ public abstract class Benchmark {
System.out.println("startIteration()");
}
System.setProperty(TIMEOUT_DIALATION_PROPERTY, Benchmark.timeoutDialation);
final Properties augmentedSystemProperties = new Properties(savedSystemProperties);
augmentSystemProperties(augmentedSystemProperties);
System.setProperties(augmentedSystemProperties);
if (validateOutput) {
System.setOut(out);
System.setErr(err);
......@@ -312,6 +327,15 @@ public abstract class Benchmark {
useBenchmarkClassLoader();
}
/**
* Augments the system properties in case additional properties need to be in
* effect during the actual benchmark iteration.
*
* @param systemProperties the system properties that need to be augmented.
* (They may be modified freely.)
*/
public void augmentSystemProperties(Properties systemProperties) { }
/**
* An actual iteration of the benchmark. This is what is timed.
*
......@@ -332,6 +356,9 @@ public abstract class Benchmark {
System.setOut(savedOut);
System.setErr(savedErr);
}
System.setProperties(savedSystemProperties);
if (verbose) {
System.out.println("stopIteration()");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment