}
public PerfTask(PerfRunData runData) {
this();
this.runData = runData;
Config config = runData.getConfig();
this.maxDepthLogStart = config.get("task.max.depth.log",0);
String logStepAtt = "log.step";
// TODO (1.5): call getClass().getSimpleName() instead.
String taskName = getClass().getName();
int idx = taskName.lastIndexOf('.');
// To support test internal classes. when we move to getSimpleName, this can be removed.
int idx2 = taskName.indexOf('$', idx);
if (idx2 != -1) idx = idx2;
String taskLogStepAtt = "log.step." + taskName.substring(idx + 1, taskName.length() - 4 /* w/o the 'Task' part */);
if (config.get(taskLogStepAtt, null) != null) {
logStepAtt = taskLogStepAtt;
}
// It's important to read this from Config, to support vals-by-round.
logStep = config.get(logStepAtt, DEFAULT_LOG_STEP);
// To avoid the check 'if (logStep > 0)' in tearDown(). This effectively
// turns logging off.
if (logStep <= 0) {
logStep = Integer.MAX_VALUE;
}