@Inject TrialOutputLogger(TrialOutputFactory outputManager, @TrialNumber int trialNumber, @TrialId UUID trialId, Experiment experiment) { this.outputManager = outputManager; this.trialNumber = trialNumber; this.trialId = trialId; this.experiment = experiment; }
@Provides @TrialScoped ListenableFuture<OpenedSocket> provideTrialSocket( @TrialId UUID trialId, ServerSocketService serverSocketService) { return serverSocketService.getConnection(trialId); }
@Provides @TrialScoped ListenableFuture<OpenedSocket> provideTrialSocket( @TrialId UUID trialId, ServerSocketService serverSocketService) { return serverSocketService.getConnection(trialId); }
@Inject WorkerProcess(@TrialId UUID trialId, ListenableFuture<OpenedSocket> openedSocket, Experiment experiment, BenchmarkSpec benchmarkSpec, @LocalPort int localPort, Gson gson, BenchmarkClass benchmarkClass, ShutdownHookRegistrar shutdownHookRegistrar) { this.trialId = trialId; this.workerBuilder = buildProcess(trialId, experiment, benchmarkSpec, localPort, gson, benchmarkClass); this.openedSocket = openedSocket; this.shutdownHookRegistrar = shutdownHookRegistrar; }
@Inject WorkerProcess(@TrialId UUID trialId, ListenableFuture<OpenedSocket> openedSocket, Experiment experiment, BenchmarkSpec benchmarkSpec, @LocalPort int localPort, BenchmarkClass benchmarkClass, ShutdownHookRegistrar shutdownHookRegistrar) { this.trialId = trialId; this.workerBuilder = buildProcess(trialId, experiment, benchmarkSpec, localPort, benchmarkClass); this.openedSocket = openedSocket; this.shutdownHookRegistrar = shutdownHookRegistrar; }
@Provides TrialFactory provideTrialFactory(@TrialId final UUID trialId, final Run run, final Host host, final Experiment experiment, final BenchmarkSpec benchmarkSpec) { return new TrialFactory() { @Override public Trial newTrial(VmDataCollectingVisitor dataCollectingVisitor, MeasurementCollectingVisitor measurementCollectingVisitor) { checkState(measurementCollectingVisitor.isDoneCollecting()); return new Trial.Builder(trialId) .run(run) .instrumentSpec(experiment.instrumentation().instrument().getSpec()) .scenario(new Scenario.Builder() .host(host) .vmSpec(dataCollectingVisitor.vmSpec()) .benchmarkSpec(benchmarkSpec)) .addAllMeasurements(measurementCollectingVisitor.getMeasurements()) .build(); } }; } }
@Provides TrialResultFactory provideTrialFactory(@TrialId final UUID trialId, final Run run, final Host host, final Experiment experiment, final BenchmarkSpec benchmarkSpec) { return new TrialResultFactory() { @Override public TrialResult newTrialResult( VmDataCollectingVisitor dataCollectingVisitor, MeasurementCollectingVisitor measurementCollectingVisitor) { checkState(measurementCollectingVisitor.isDoneCollecting()); // TODO(lukes): should the trial messages be part of the Trial datastructure? It seems like // the web UI could make use of them. return new TrialResult( new Trial.Builder(trialId) .run(run) .instrumentSpec(experiment.instrumentation().instrument().getSpec()) .scenario(new Scenario.Builder() .host(host) .vmSpec(dataCollectingVisitor.vmSpec()) .benchmarkSpec(benchmarkSpec)) .addAllMeasurements(measurementCollectingVisitor.getMeasurements()) .build(), experiment, measurementCollectingVisitor.getMessages()); } }; } }