diff options
Diffstat (limited to 'caliper/src/main/java/com/google/caliper/runner/ExperimentingRunnerModule.java')
-rw-r--r-- | caliper/src/main/java/com/google/caliper/runner/ExperimentingRunnerModule.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/caliper/src/main/java/com/google/caliper/runner/ExperimentingRunnerModule.java b/caliper/src/main/java/com/google/caliper/runner/ExperimentingRunnerModule.java index 7abcbd9..4477a61 100644 --- a/caliper/src/main/java/com/google/caliper/runner/ExperimentingRunnerModule.java +++ b/caliper/src/main/java/com/google/caliper/runner/ExperimentingRunnerModule.java @@ -39,7 +39,8 @@ import com.google.common.util.concurrent.Service; import dagger.MapKey; import dagger.Module; import dagger.Provides; -import dagger.Provides.Type; +import dagger.multibindings.IntoMap; +import dagger.multibindings.IntoSet; import java.io.PrintWriter; import java.lang.reflect.Method; @@ -60,12 +61,14 @@ import javax.inject.Singleton; final class ExperimentingRunnerModule { private static final String RUNNER_MAX_PARALLELISM_OPTION = "runner.maxParallelism"; - @Provides(type = Type.SET) + @Provides + @IntoSet static Service provideServerSocketService(ServerSocketService impl) { return impl; } - @Provides(type = Type.SET) + @Provides + @IntoSet static Service provideTrialOutputFactoryService(TrialOutputFactoryService impl) { return impl; } @@ -102,13 +105,15 @@ final class ExperimentingRunnerModule { Class<? extends ResultProcessor> value(); } - @Provides(type = Type.MAP) + @Provides + @IntoMap @ResultProcessorClassKey(OutputFileDumper.class) static ResultProcessor provideOutputFileDumper(OutputFileDumper impl) { return impl; } - @Provides(type = Type.MAP) + @Provides + @IntoMap @ResultProcessorClassKey(HttpUploader.class) static ResultProcessor provideHttpUploader(HttpUploader impl) { return impl; @@ -157,19 +162,22 @@ final class ExperimentingRunnerModule { Class<? extends Instrument> value(); } - @Provides(type = Type.MAP) + @Provides + @IntoMap @InstrumentClassKey(ArbitraryMeasurementInstrument.class) static Instrument provideArbitraryMeasurementInstrument() { return new ArbitraryMeasurementInstrument(); } - @Provides(type = Type.MAP) + @Provides + @IntoMap @InstrumentClassKey(AllocationInstrument.class) static Instrument provideAllocationInstrument() { return new AllocationInstrument(); } - @Provides(type = Type.MAP) + @Provides + @IntoMap @InstrumentClassKey(RuntimeInstrument.class) static Instrument provideRuntimeInstrument( @NanoTimeGranularity ShortDuration nanoTimeGranularity) { |