• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Control类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.openjdk.jmh.infra.Control的典型用法代码示例。如果您正苦于以下问题:Java Control类的具体用法?Java Control怎么用?Java Control使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Control类属于org.openjdk.jmh.infra包,在下文中一共展示了Control类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: timerThroughputTest

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Benchmark
public void timerThroughputTest(Control ctrl) throws InterruptedException {
  counterDown.set(times);
  for (int i = 0; i < times; i++) {
    timer.schedule(new Runnable() {
                     @Override
                     public void run() {
                       counterDown.decrementAndGet();
                     }
                   },
                   delay,
                   TimeUnit.MILLISECONDS);
  }

  while (!ctrl.stopMeasurement && counterDown.get() > 0) {
    // spin
  }

}
 
开发者ID:ifesdjeen,项目名称:hashed-wheel-timer,代码行数:20,代码来源:AbstractBenchmark.java


示例2: trackWithDelayedAcks

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@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);
  }
}
 
开发者ID:apache,项目名称:incubator-gobblin,代码行数:18,代码来源:FineGrainedWatermarkTrackerBenchmark.java


示例3: scheduledDelayedAcks

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@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);
  }
}
 
开发者ID:apache,项目名称:incubator-gobblin,代码行数:17,代码来源:FineGrainedWatermarkTrackerBenchmark.java


示例4: scheduledNoRandomDelayedAcks

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@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);
  }
}
 
开发者ID:apache,项目名称:incubator-gobblin,代码行数:17,代码来源:FineGrainedWatermarkTrackerBenchmark.java


示例5: tenMixedArgsCaller

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Benchmark
@Group("tenMixedArgs")
@GroupThreads(PRODUCER_THREADS)
public boolean tenMixedArgsCaller(final Control control, final CallerCounters counters) {
    this.waitStrategy.control = control;
    try {
        this.proxy.tenMixedArgs(this.intArg,
                this.objArg,
                this.longArg,
                this.customType0,
                this.doubleArg,
                this.customType1,
                this.floatArg,
                this.customType2,
                this.booleanArg,
                this.customType3);
        counters.callsFailed = this.waitStrategy.retries;
        return true;
    } catch (final StoppedException e) {
        return false;
    }
}
 
开发者ID:JCTools,项目名称:JCTools,代码行数:23,代码来源:MpscProxyChannelBenchmark.java


示例6: ping

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Benchmark
@Group("pingpong")
public void ping(Control cnt) {
    while (!cnt.stopMeasurement && !flag.compareAndSet(false, true)) {
        // this body is intentionally left blank
    }
}
 
开发者ID:mumudemo,项目名称:mumu-benchmark,代码行数:8,代码来源:JMHSample_18_Control.java


示例7: pong

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Benchmark
@Group("pingpong")
public void pong(Control cnt) {
    while (!cnt.stopMeasurement && !flag.compareAndSet(true, false)) {
        // this body is intentionally left blank
    }
}
 
开发者ID:mumudemo,项目名称:mumu-benchmark,代码行数:8,代码来源:JMHSample_18_Control.java


示例8: multiTimerTest

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Benchmark
public void multiTimerTest(Control ctrl) throws InterruptedException {
  int threads = 10;
  counterDown.set(times * threads);
  for (int i = 0; i < threads; i++) {
    final int idx = i;
    new Thread(new Runnable() {
      @Override
      public void run() {
        try {
          Thread.sleep(10 * idx);
        } catch (InterruptedException e) {
        }
        for (int j = 0; j < times; j++) {
          timer.schedule(new Runnable() {
                           @Override
                           public void run() {
                             counterDown.decrementAndGet();
                           }
                         },
                         delay,
                         TimeUnit.MILLISECONDS);
        }
      }
    }).start();
  }

  while (!ctrl.stopMeasurement && counterDown.get() > 0) {
    // spin
  }

}
 
开发者ID:ifesdjeen,项目名称:hashed-wheel-timer,代码行数:33,代码来源:AbstractBenchmark.java


示例9: timerThroughputTest

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
public void timerThroughputTest(Control ctrl) throws InterruptedException {
  counterDown.set(times);
  for (int i = 0; i < times; i++) {
    timer.newTimeout((TimerTask) (v) -> counterDown.decrementAndGet(),
                     delay,
                     TimeUnit.MILLISECONDS);
  }

  while (!ctrl.stopMeasurement && counterDown.get() > 0) {
    // spin
  }

}
 
开发者ID:ifesdjeen,项目名称:hashed-wheel-timer,代码行数:14,代码来源:NettyTimerBenchmark.java


示例10: send1

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Group("mpsc")
@GroupThreads(1)
@Benchmark
public void send1(Control control) {
    final MpscLinkedArrayQueue<Integer> q = queue;
    while (!q.offer(1) && !control.stopMeasurement) {
    }
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:9,代码来源:MpscLinkedArrayQueueXPerf.java


示例11: recv1

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Group("mpsc")
@GroupThreads(1)
@Benchmark
public void recv1(Control control) {
    final MpscLinkedArrayQueue<Integer> q = queue;
    while (!control.stopMeasurement && q.poll() == null) {
        ;
    }
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:10,代码来源:MpscLinkedArrayQueueXPerf.java


示例12: send2

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Group("spscLinked")
@GroupThreads(1)
@Benchmark
public void send2(Control control) {
    final SpscLinkedArrayQueue<Integer> q = q2;
    while (!q.offer(1) && !control.stopMeasurement) {
    }
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:9,代码来源:MpscLinkedArrayQueueXPerf.java


示例13: recv2

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Group("spscLinked")
@GroupThreads(1)
@Benchmark
public void recv2(Control control) {
    final SpscLinkedArrayQueue<Integer> q = q2;
    while (!control.stopMeasurement && q.poll() == null) {
        ;
    }
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:10,代码来源:MpscLinkedArrayQueueXPerf.java


示例14: send3

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Group("spsc")
@GroupThreads(1)
@Benchmark
public void send3(Control control) {
    final SpscArrayQueue<Integer> q = q3;
    while (!q.offer(1) && !control.stopMeasurement) {
    }
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:9,代码来源:MpscLinkedArrayQueueXPerf.java


示例15: recv3

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Group("spsc")
@GroupThreads(1)
@Benchmark
public void recv3(Control control) {
    final SpscArrayQueue<Integer> q = q3;
    while (!control.stopMeasurement && q.poll() == null) {
        ;
    }
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:10,代码来源:MpscLinkedArrayQueueXPerf.java


示例16: send4

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Group("mpmca")
@GroupThreads(1)
@Benchmark
public void send4(Control control) {
    final FAAArrayQueue<Integer> q = q4;
    q.enqueue(1);
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:8,代码来源:MpscLinkedArrayQueueXPerf.java


示例17: recv4

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Group("mpmca")
@GroupThreads(1)
@Benchmark
public void recv4(Control control) {
    final FAAArrayQueue<Integer> q = q4;
    while (!control.stopMeasurement && q.dequeue() == null) {
        ;
    }
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:10,代码来源:MpscLinkedArrayQueueXPerf.java


示例18: send5

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Group("mpmcb")
@GroupThreads(1)
@Benchmark
public void send5(Control control) {
    final FAAArrayQueueV2<Integer> q = q5;
    q.enqueue(1);
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:8,代码来源:MpscLinkedArrayQueueXPerf.java


示例19: recv5

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Group("mpmcb")
@GroupThreads(1)
@Benchmark
public void recv5(Control control) {
    final FAAArrayQueueV2<Integer> q = q5;
    while (!control.stopMeasurement && q.dequeue() == null) {
        ;
    }
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:10,代码来源:MpscLinkedArrayQueueXPerf.java


示例20: send1

import org.openjdk.jmh.infra.Control; //导入依赖的package包/类
@Group("primitive")
@GroupThreads(1)
@Benchmark
public void send1(Control control) {
    SpscIntArrayQueue q = queue;
    while (!q.offer(1) && !control.stopMeasurement) {
    }
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:9,代码来源:SpscIntArrayQueueXPerf.java



注:本文中的org.openjdk.jmh.infra.Control类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Sms类代码示例发布时间:2022-05-22
下一篇:
Java XmlAttributeValuePattern类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap