self.profile = context.config.get("benchmark-run", "profile",
default="benchmark-caliper-0.5")
self.confs = context.config.getlist("benchmark-run", "confs")
self.java_args = context.config.getlist("benchmark-run", "args",
default=["-Xmx1g", "-XX:MaxPermSize=256m"])
self.agent_profile = context.config.get("benchmark-run", "agent_profile",
default="benchmark-java-allocation-instrumenter-2.1")
// TODO(Steve Gury):
// Find all the target classes from the Benchmark target itself
// https://jira.twitter.biz/browse/AWESOME-1938
self.caliper_args = context.options.target_class
if context.options.memory_profiling:
self.caliper_args += ["--measureMemory"]
// For rewriting JDK classes to work, the JAR file has to be listed specifically in
// the JAR manifest as something that goes in the bootclasspath.
// The MANIFEST list a jar "allocation.jar" this is why we have to rename it
agent_jar = os.readlink(profile_classpath(self.agent_profile)[0])allocation_jar = os.path.join(os.path.dirname(agent_jar), "allocation.jar")
// TODO(Steve Gury): Find a solution to avoid copying the jar every run and being resilient
// to version upgrade
shutil.copyfile(agent_jar, allocation_jar)
os.environ["ALLOCATION_JAR"] = str(allocation_jar)