/** Marks the log file so that it will not be deleted at the end of the benchmark. */ void ensureFileIsSaved() { checkOpened(); outputManager.persistFile(file); }
/** Returns the log file path. */ File trialOutputFile() { checkOpened(); return file; } }
@Override public void visit(HotspotLogMessage logMessage) { if (!isInWarmup()) { if (measuring && notifiedAboutMeasuringJit) { hotspotWhileMeasuring(); notifiedAboutMeasuringJit = true; } else if (notifiedAboutJit) { hotspotWhileNotMeasuring(); notifiedAboutJit = true; } } }
public static ExperimentModule forExperiment(Experiment experiment) { Method benchmarkMethod = experiment.instrumentation().benchmarkMethod(); return new ExperimentModule(benchmarkMethod.getDeclaringClass(), benchmarkMethod, experiment.userParameters()); }
@Provides @TrialScoped TrialSchedulingPolicy provideTrialSchedulingPolicy(Experiment experiment) { return experiment.instrumentation().instrument().schedulingPolicy(); }
@Provides @TrialScoped ListenableFuture<OpenedSocket> provideTrialSocket( @TrialId UUID trialId, ServerSocketService serverSocketService) { return serverSocketService.getConnection(trialId); }
@Override public void visit(HotspotLogMessage logMessage) { if (isWarmupComplete()) { if (measuring && notifiedAboutMeasuringJit) { hotspotWhileMeasuring(); notifiedAboutMeasuringJit = true; } else if (notifiedAboutJit) { hotspotWhileNotMeasuring(); notifiedAboutJit = true; } } }
@Provides @AfterExperimentMethods ImmutableSet<Method> provideAfterExperimentMethods( BenchmarkClass benchmarkClass) { return benchmarkClass.afterExperimentMethods(); } }
@Inject TrialOutputLogger(TrialOutputFactory outputManager, @TrialNumber int trialNumber, @TrialId UUID trialId, Experiment experiment) { this.outputManager = outputManager; this.trialNumber = trialNumber; this.trialId = trialId; this.experiment = experiment; }
@Override public void visit(GcLogMessage logMessage) { if (measuring && isWarmupComplete() && !notifiedAboutGc) { gcWhileMeasuring(); notifiedAboutGc = true; } }
@Override MeasurementCollectingVisitor getMeasurementCollectingVisitor() { return new SingleMeasurementCollectingVisitor(); } }
/** * Makes a new TrialContext that can be used to invoke */ static TrialContext makeContext(UUID trialId, int trialNumber, Experiment experiment) { return new TrialContext(trialId, trialNumber, experiment); }
/** Opens the trial output file. */ synchronized void open() throws IOException { if (writer == null) { FileAndWriter fileAndWriter = outputManager.getTrialOutputFile(trialNumber); file = fileAndWriter.file; writer = fileAndWriter.writer; } }
private void log(String text) { trialOutput.log("socket", text); } }
public static ExperimentModule forExperiment(Experiment experiment) { Method benchmarkMethod = experiment.instrumentation().benchmarkMethod(); return new ExperimentModule(benchmarkMethod.getDeclaringClass(), benchmarkMethod, experiment.userParameters()); }
@Provides @TrialScoped ListenableFuture<OpenedSocket> provideTrialSocket( @TrialId UUID trialId, ServerSocketService serverSocketService) { return serverSocketService.getConnection(trialId); }
@Override MeasurementCollectingVisitor getMeasurementCollectingVisitor() { return new SingleMeasurementCollectingVisitor(); } }
/** * Makes a new TrialContext that can be used to invoke */ static TrialContext makeContext(UUID trialId, int trialNumber, Experiment experiment) { return new TrialContext(trialId, trialNumber, experiment); }