Java 类org.openjdk.jmh.annotations.Group 实例源码

项目:incubator-gobblin    文件:FineGrainedWatermarkTrackerBenchmark.java   
@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);
  }
}
项目:incubator-gobblin    文件:FineGrainedWatermarkTrackerBenchmark.java   
@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);
  }
}
项目:incubator-gobblin    文件:FineGrainedWatermarkTrackerBenchmark.java   
@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);
  }
}
项目:commcare-core    文件:LoadAndInitLargeForm.java   
@Benchmark()
@Group("form_init")
public void recForm() throws Exception {
    MockApp mockApp = new MockApp("/app_performance/");
    MockSessionNavigationResponder mockSessionNavigationResponder =
            new MockSessionNavigationResponder(mockApp.getSession());
    SessionNavigator sessionNavigator =
            new SessionNavigator(mockSessionNavigationResponder);
    SessionWrapper session = mockApp.getSession();
    sessionNavigator.startNextSessionStep();
    session.setCommand("m1");
    sessionNavigator.startNextSessionStep();
    session.setDatum("case_id", "3b6bff05-b9c3-42d8-9b12-9b27a834d330");
    sessionNavigator.startNextSessionStep();

    session.setCommand("m1-f2");
    sessionNavigator.startNextSessionStep();
    session.setDatum("case_id_new_imci_visit_0",
            "593ef28a-34ff-421d-a29c-6a0fd975df95");
    sessionNavigator.startNextSessionStep();

    FormEntryController fec = mockApp.loadAndInitForm("large_tdh_form.xml");
    fec.getModel().getEvent();
}
项目:mumu-benchmark    文件:JMHSample_18_Control.java   
@Benchmark
@Group("pingpong")
public void ping(Control cnt) {
    while (!cnt.stopMeasurement && !flag.compareAndSet(false, true)) {
        // this body is intentionally left blank
    }
}
项目:mumu-benchmark    文件:JMHSample_18_Control.java   
@Benchmark
@Group("pingpong")
public void pong(Control cnt) {
    while (!cnt.stopMeasurement && !flag.compareAndSet(true, false)) {
        // this body is intentionally left blank
    }
}
项目:buffer-slayer    文件:SizeBoundedQueueBenchmark.java   
@Benchmark @Group("no_contention") @GroupThreads(1)
public void no_contention_drain(DrainCounters counters, ConsumerMarker cm) {
  q.drainTo(next -> {
    counters.drained++;
    next.deferred.resolve(null);
    return true;
  });
}
项目:buffer-slayer    文件:SizeBoundedQueueBenchmark.java   
@Benchmark @Group("mild_contention") @GroupThreads(1)
public void mild_contention_drain(DrainCounters counters, ConsumerMarker cm) {
  q.drainTo(next -> {
    counters.drained++;
    next.deferred.resolve(null);
    return true;
  });
}
项目:buffer-slayer    文件:SizeBoundedQueueBenchmark.java   
@Benchmark @Group("high_contention") @GroupThreads(1)
public void high_contention_drain(DrainCounters counters, ConsumerMarker cm) {
  q.drainTo(next -> {
    counters.drained++;
    next.deferred.resolve(null);
    return true;
  });
}
项目:benchmarks    文件:QueueBenchmark.java   
@Benchmark
@Group("g")
   @GroupThreads(3)
public void writing()
{
    concurrentLinkedQueue.offer("test");
}
项目:benchmarks    文件:QueueBenchmark.java   
@Benchmark
@Group("g")
   @GroupThreads(1)
public void reading()
{
    concurrentLinkedQueue.poll();
}
项目:zipkin-reporter-java    文件:ByteBoundedQueueBenchmarks.java   
@Benchmark @Group("no_contention") @GroupThreads(1)
public void no_contention_offer(OfferCounters counters) {
  if (q.offer(ONE, 1)) {
    counters.offersMade++;
  } else {
    counters.offersFailed++;
  }
}
项目:zipkin-reporter-java    文件:ByteBoundedQueueBenchmarks.java   
@Benchmark @Group("no_contention") @GroupThreads(1)
public void no_contention_drain(DrainCounters counters, ConsumerMarker cm) {
  q.drainTo((s, b) -> {
    counters.drained++;
    return true;
  }, 1000);
}
项目:zipkin-reporter-java    文件:ByteBoundedQueueBenchmarks.java   
@Benchmark @Group("mild_contention") @GroupThreads(2)
public void mild_contention_offer(OfferCounters counters) {
  if (q.offer(ONE, 1)) {
    counters.offersMade++;
  } else {
    counters.offersFailed++;
  }
}
项目:zipkin-reporter-java    文件:ByteBoundedQueueBenchmarks.java   
@Benchmark @Group("mild_contention") @GroupThreads(1)
public void mild_contention_drain(DrainCounters counters, ConsumerMarker cm) {
  q.drainTo((s, b) -> {
    counters.drained++;
    return true;
  }, 1000);
}
项目:zipkin-reporter-java    文件:ByteBoundedQueueBenchmarks.java   
@Benchmark @Group("high_contention") @GroupThreads(8)
public void high_contention_offer(OfferCounters counters) {
  if (q.offer(ONE, 1)) {
    counters.offersMade++;
  } else {
    counters.offersFailed++;
  }
}
项目:zipkin-reporter-java    文件:ByteBoundedQueueBenchmarks.java   
@Benchmark @Group("high_contention") @GroupThreads(1)
public void high_contention_drain(DrainCounters counters, ConsumerMarker cm) {
  q.drainTo((s, b) -> {
    counters.drained++;
    return true;
  }, 1000);
}
项目:safepoint-experiments    文件:LoveAtATimeOfSafepoints.java   
@Benchmark
@Group("run_together")
public boolean contains1() {
    int needle = 1;
    byte[] haystack = soggyBottoms;
    return containsNeedle1(needle, haystack);
}
项目:safepoint-experiments    文件:LoveAtATimeOfSafepoints.java   
@Benchmark
@Group("run_together")
public boolean contains1ToK() {
    byte[] haystack = soggyBottoms;
    for (int needle = 1; needle <= k; needle++) {
        if (containsNeedle2(needle, haystack)) {
            return true;
        }
    }
    return false;
}
项目:safepoint-experiments    文件:LoveAtATimeOfSafepoints.java   
@Benchmark
@Group("run_together")
public Object safepoint() {
    if (intervalMs == 0)
        return null;
    LockSupport.parkNanos(intervalMs * 1000000);
    return safepointMethod();
}
项目:safepoint-experiments    文件:LoveAtATimeOfSafepoints.java   
@Benchmark
@Group("run_together")
public void park() {
    if (intervalMs == 0)
        return;
    LockSupport.parkNanos(intervalMs * 1000000);
}
项目:lin-check    文件:QueueThroughputBusy.java   
@GenerateMicroBenchmark
@Group("tpt")
public void offer(OpCounters counters) {
    if (!q.offer(ONE)) {
        counters.offerFail++;
    } 
    if (DELAY_PRODUCER != 0) {
        BlackHole.consumeCPU(DELAY_PRODUCER);
    }
}
项目:lin-check    文件:QueueThroughputBusy.java   
@GenerateMicroBenchmark
@Group("tpt")
public void poll(OpCounters counters, ConsumerMarker cm) {
    if (q.poll() == null) {
        counters.pollFail++;
    } 
    if (DELAY_CONSUMER != 0) {
        BlackHole.consumeCPU(DELAY_CONSUMER);
    }
}
项目:lin-check    文件:QueueThroughputYield.java   
@GenerateMicroBenchmark
@Group("tpt")
public void offer(OpCounters counters) {
    if (!q.offer(ONE)) {
        counters.offerFail++;
        Thread.yield();
    } 
    if (DELAY_PRODUCER != 0) {
        BlackHole.consumeCPU(DELAY_PRODUCER);
    }
}
项目:lin-check    文件:QueueThroughputYield.java   
@GenerateMicroBenchmark
@Group("tpt")
public void poll(OpCounters counters, ConsumerMarker cm) {
    if (q.poll() == null) {
        counters.pollFail++;
        Thread.yield();
    } 
    if (DELAY_CONSUMER != 0) {
        BlackHole.consumeCPU(DELAY_CONSUMER);
    }
}
项目:resilience4j    文件:CircularBufferBenchmark.java   
@Benchmark
@Warmup(iterations = WARMUP_COUNT)
@Fork(value = FORK_COUNT)
@Measurement(iterations = ITERATION_COUNT)
@Group("circularBuffer")
@GroupThreads(1)
public void circularBufferAddEvent() {
    circularFifoBuffer.add(event);
}
项目:resilience4j    文件:CircularBufferBenchmark.java   
@Benchmark
@Warmup(iterations = WARMUP_COUNT)
@Fork(value = FORK_COUNT)
@Measurement(iterations = ITERATION_COUNT)
@Group("circularBuffer")
@GroupThreads(1)
public void circularBufferToList(Blackhole bh) {
    List<Object> events = circularFifoBuffer.toList();
    bh.consume(events);
}
项目:resilience4j    文件:CircularBufferBenchmark.java   
@Benchmark
@Warmup(iterations = WARMUP_COUNT)
@Fork(value = FORK_COUNT)
@Measurement(iterations = ITERATION_COUNT)
@Group("circularBuffer")
@GroupThreads(1)
public void circularBufferSize(Blackhole bh) {
    int size = circularFifoBuffer.size();
    bh.consume(size);
}
项目:resilience4j    文件:CircularBufferBenchmark.java   
@Benchmark
@Warmup(iterations = WARMUP_COUNT)
@Fork(value = FORK_COUNT)
@Measurement(iterations = ITERATION_COUNT)
@Group("circularBuffer")
@GroupThreads(1)
public void circularBufferTakeEvent(Blackhole bh) {
    Option<Object> event = circularFifoBuffer.take();
    bh.consume(event);
}
项目:resilience4j    文件:ConcurrentEvictingQueueBenchmark.java   
@Benchmark
@Warmup(iterations = WARMUP_COUNT)
@Fork(value = FORK_COUNT)
@Measurement(iterations = ITERATION_COUNT)
@Group("concurrentEvictingQueue")
@GroupThreads(2)
public void concurrentEvictingQueueAdd() {
    queue.add(event);
}
项目:resilience4j    文件:ConcurrentEvictingQueueBenchmark.java   
@Benchmark
@Warmup(iterations = WARMUP_COUNT)
@Fork(value = FORK_COUNT)
@Measurement(iterations = ITERATION_COUNT)
@Group("concurrentEvictingQueue")
@GroupThreads(1)
public void concurrentEvictingQueueSize(Blackhole bh) {
    int size = queue.size();
    bh.consume(size);
}
项目:resilience4j    文件:ConcurrentEvictingQueueBenchmark.java   
@Benchmark
@Warmup(iterations = WARMUP_COUNT)
@Fork(value = FORK_COUNT)
@Measurement(iterations = ITERATION_COUNT)
@Group("concurrentEvictingQueue")
@GroupThreads(1)
public void concurrentEvictingQueuePoll(Blackhole bh) {
    Object event = queue.poll();
    bh.consume(event);
}
项目:resilience4j    文件:ConcurrentEvictingQueueBenchmark.java   
@Benchmark
@Warmup(iterations = WARMUP_COUNT)
@Fork(value = FORK_COUNT)
@Measurement(iterations = ITERATION_COUNT)
@Group("concurrentEvictingQueue")
@GroupThreads(1)
public void concurrentEvictingQueuePeek(Blackhole bh) {
    Object event = queue.peek();
    bh.consume(event);
}
项目:ignite    文件:JmhParkVsNotifyBenchmark.java   
/**
 *
 */
@Benchmark
@Group("park")
public void park() {
    if (thread == null)
        thread = Thread.currentThread();

    LockSupport.park(thread);
}
项目:ignite    文件:JmhParkVsNotifyBenchmark.java   
/**
 *
 */
@Benchmark
@GroupThreads(THREAD_COUNT)
@Group("park")
public void unpark() {
    LockSupport.unpark(thread);
}
项目:ignite    文件:JmhParkVsNotifyBenchmark.java   
/**
 *
 */
@Benchmark
@Group("condition")
@GroupThreads(THREAD_COUNT)
public void notifyAll0() {
    synchronized (mux) {
        mux.notify();
    }
}
项目:ignite    文件:JmhParkVsNotifyBenchmark.java   
/**
 *
 */
@Benchmark
@Group("condition")
public void wait0() throws InterruptedException {
    synchronized (mux) {
        mux.wait();
    }
}
项目:incubator-gobblin    文件:FineGrainedWatermarkTrackerBenchmark.java   
@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();
  }
}
项目:jmh    文件:GroupStateOrderTest.java   
@Benchmark
@BenchmarkMode(Mode.All)
@Warmup(iterations = 0)
@Measurement(iterations = 1, time = 100, timeUnit = TimeUnit.MILLISECONDS)
@Fork(1)
@Group("T")
public void test(MyState state) {
    state.tickRun = TICKER.incrementAndGet();
    Fixtures.work();
}
项目:jmh    文件:JMHSample_18_Control.java   
@Benchmark
@Group("pingpong")
public void pong(Control cnt) {
    while (!cnt.stopMeasurement && !flag.compareAndSet(true, false)) {
        // this body is intentionally left blank
    }
}