Search in sources :

Example 1 with Group

use of org.openjdk.jmh.annotations.Group in project incubator-gobblin by apache.

the class FineGrainedWatermarkTrackerBenchmark method trackWithDelayedAcks.

@Benchmark
@Group("trackDelayed")
public void trackWithDelayedAcks(Control control, TrackerState trackerState) throws Exception {
    if (!control.stopMeasurement) {
        final AcknowledgableWatermark wmark = new AcknowledgableWatermark(new DefaultCheckpointableWatermark("0", new LongWatermark(trackerState._index)));
        trackerState._watermarkTracker.track(wmark);
        trackerState._index++;
        int delay = trackerState._random.nextInt(10);
        trackerState._executorService.schedule(new Runnable() {

            @Override
            public void run() {
                wmark.ack();
            }
        }, delay, TimeUnit.MILLISECONDS);
    }
}
Also used : DefaultCheckpointableWatermark(org.apache.gobblin.source.extractor.DefaultCheckpointableWatermark) LongWatermark(org.apache.gobblin.source.extractor.extract.LongWatermark) Group(org.openjdk.jmh.annotations.Group) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 2 with Group

use of org.openjdk.jmh.annotations.Group in project incubator-gobblin by apache.

the class FineGrainedWatermarkTrackerBenchmark method scheduledDelayedAcks.

@Benchmark
@Group("scheduledDelayed")
public void scheduledDelayedAcks(Control control, TrackerState trackerState) throws Exception {
    if (!control.stopMeasurement) {
        final AcknowledgableWatermark wmark = new AcknowledgableWatermark(new DefaultCheckpointableWatermark("0", new LongWatermark(trackerState._index)));
        trackerState._index++;
        int delay = trackerState._random.nextInt(10);
        trackerState._executorService.schedule(new Runnable() {

            @Override
            public void run() {
                wmark.ack();
            }
        }, delay, TimeUnit.MILLISECONDS);
    }
}
Also used : DefaultCheckpointableWatermark(org.apache.gobblin.source.extractor.DefaultCheckpointableWatermark) LongWatermark(org.apache.gobblin.source.extractor.extract.LongWatermark) Group(org.openjdk.jmh.annotations.Group) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 3 with Group

use of org.openjdk.jmh.annotations.Group in project incubator-gobblin by apache.

the class FineGrainedWatermarkTrackerBenchmark method scheduledNoRandomDelayedAcks.

@Benchmark
@Group("scheduledNoRandom")
public void scheduledNoRandomDelayedAcks(Control control, TrackerState trackerState) throws Exception {
    if (!control.stopMeasurement) {
        final AcknowledgableWatermark wmark = new AcknowledgableWatermark(new DefaultCheckpointableWatermark("0", new LongWatermark(trackerState._index)));
        trackerState._index++;
        int delay = 10;
        trackerState._executorService.schedule(new Runnable() {

            @Override
            public void run() {
                wmark.ack();
            }
        }, delay, TimeUnit.MILLISECONDS);
    }
}
Also used : DefaultCheckpointableWatermark(org.apache.gobblin.source.extractor.DefaultCheckpointableWatermark) LongWatermark(org.apache.gobblin.source.extractor.extract.LongWatermark) Group(org.openjdk.jmh.annotations.Group) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 4 with Group

use of org.openjdk.jmh.annotations.Group in project incubator-gobblin by apache.

the class FineGrainedWatermarkTrackerBenchmark method trackImmediateAcks.

@Benchmark
@Group("trackImmediate")
public void trackImmediateAcks(Control control, TrackerState trackerState) throws Exception {
    if (!control.stopMeasurement) {
        AcknowledgableWatermark wmark = new AcknowledgableWatermark(new DefaultCheckpointableWatermark("0", new LongWatermark(trackerState._index)));
        trackerState._watermarkTracker.track(wmark);
        trackerState._index++;
        wmark.ack();
    }
}
Also used : DefaultCheckpointableWatermark(org.apache.gobblin.source.extractor.DefaultCheckpointableWatermark) LongWatermark(org.apache.gobblin.source.extractor.extract.LongWatermark) Group(org.openjdk.jmh.annotations.Group) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

DefaultCheckpointableWatermark (org.apache.gobblin.source.extractor.DefaultCheckpointableWatermark)4 LongWatermark (org.apache.gobblin.source.extractor.extract.LongWatermark)4 Benchmark (org.openjdk.jmh.annotations.Benchmark)4 Group (org.openjdk.jmh.annotations.Group)4