本文整理了Java中org.openjdk.jmh.annotations.Measurement.<init>()
方法的一些代码示例,展示了Measurement.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Measurement.<init>()
方法的具体详情如下:
包路径:org.openjdk.jmh.annotations.Measurement
类名称:Measurement
方法名:<init>
暂无
代码示例来源:origin: cglib/cglib
@Fork(value = 1, jvmArgsPrepend = "-Xmx128m")
@Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS)
@Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS)
@State(Scope.Thread)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public class BeansBenchmark {
@Benchmark
public Object newInstance() {
return Beans.newInstance(Beans.class);
}
@Benchmark
public Object baseline() {
return new Beans();
}
public static void main(String[] args) throws RunnerException
{
Options opt = new OptionsBuilder()
.include(BeansBenchmark.class.getSimpleName())
.addProfiler(GCProfiler.class)
.detectJvmArgs()
.build();
new Runner(opt).run();
}
}
代码示例来源:origin: btraceio/btrace
@Warmup(iterations = 5, time = 200, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = 5, time = 1200, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
public void testStrCat() {
res = st.concat(STRING_PART).concat(STRING_PART);
}
代码示例来源:origin: Vedenin/useful-java-links
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS)
@Fork(1)
@State(Scope.Benchmark)
public class ConvertStringToInputStreamBenchmark {
private static final String test1 = "test184768612876481276487612876417826487216478216784621784672816478216784621784621786478216478216784261784621782178647281647821647821697421687126784621874621786478216478216874";
代码示例来源:origin: btraceio/btrace
@Warmup(iterations = 5, time = 200, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = 5, time = 1200, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
public void testStringPlus() {
res = st + STRING_PART + STRING_PART;
}
代码示例来源:origin: apache/incubator-druid
@State(Scope.Benchmark)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@Warmup(iterations = 5)
@Measurement(iterations = 10)
@Fork(1)
public class CachingCostBalancerStrategyBenchmark
代码示例来源:origin: btraceio/btrace
@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
public void testInstrDuration() {
durCounter++;
}
代码示例来源:origin: JCTools/JCTools
@State(Scope.Group)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@Fork(2)
@Warmup(iterations = 10)
@Measurement(iterations = 10)
public class CountersBenchmark {
代码示例来源:origin: btraceio/btrace
@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
public void testInstrumentedMethodLevelNoMatch() {
counter++;
}
代码示例来源:origin: micrometer-metrics/micrometer
@Fork(1)
@Measurement(iterations = 2)
@Warmup(iterations = 2)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public class TagsBenchmark {
@Threads(16)
@Benchmark
public void of() {
Tags.of("key", "value", "key2", "value2", "key3", "value3", "key4", "value4", "key5", "value5");
}
@Threads(16)
@Benchmark
public void dotAnd() {
Tags.of("key", "value").and("key2", "value2", "key3", "value3", "key4", "value4", "key5", "value5");
}
public static void main(String[] args) throws RunnerException {
Options opt = new OptionsBuilder()
.include(TagsBenchmark.class.getSimpleName())
.build();
new Runner(opt).run();
}
}
代码示例来源:origin: btraceio/btrace
@Warmup(iterations = 5, time = 100, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
public void testMethod() {
counter++;
}
代码示例来源:origin: openzipkin/brave
@Measurement(iterations = 5, time = 1)
@Warmup(iterations = 10, time = 1)
@Fork(3)
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public class TagContextBinaryMarshallerBenchmarks {
static final TagContextBinaryMarshaller marshaller = new TagContextBinaryMarshaller();
代码示例来源:origin: btraceio/btrace
@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
public void testInstrumentedMethodSampled() {
counter++;
}
代码示例来源:origin: JCTools/JCTools
/**
* Measure cost of offer/poll on single thread.
*
* @author nitsanw
*
*/
@State(Scope.Thread)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@Warmup(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS)
public class ConcQOfferPoll {
private static final int BURST_SIZE = Integer.getInteger("burst.size", 1);
private static final Integer DUMMY_MESSAGE = 1;
private final ConcurrentQueue<Integer> q = ConcurrentQueueByTypeFactory.createQueue();
private final ConcurrentQueueConsumer<Integer> c = q.consumer();
private final ConcurrentQueueProducer<Integer> p = q.producer();
@Benchmark
public void offerAndPoll() {
for (int i = 0; i < BURST_SIZE; i++) {
p.offer(DUMMY_MESSAGE);
}
for (int i = 0; i < BURST_SIZE; i++) {
c.poll();
}
}
}
代码示例来源:origin: btraceio/btrace
@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
public void testInstrumentedMethodPrintln2() {
counter++;
}
代码示例来源:origin: Vedenin/useful-java-links
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS)
@Fork(1)
@State(Scope.Benchmark)
public class FindCountOfOccurrencesBigBenchmark {
public static final String testString = "a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c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.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.da.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d" ;
代码示例来源:origin: btraceio/btrace
@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
public void testInstrumentedMethodPrintln24() {
counter++;
}
代码示例来源:origin: Vedenin/useful-java-links
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS)
@Fork(1)
@State(Scope.Benchmark)
public class FindCountOfOccurrencesBenchmark {
public static final String testString = "a.b.c.d";
代码示例来源:origin: btraceio/btrace
@Warmup(iterations = 5, time = 200, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = 5, time = 1200, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
public void testStringBuilder() {
sb.append(STRING_PART).append(STRING_PART);
}
代码示例来源:origin: debezium/debezium
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@Fork(value = 1)
@Warmup(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
public void antlr(ParserState state) {
state.antlrParser.parse(state.ddl, state.tables);
}
}
代码示例来源:origin: btraceio/btrace
@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
public void testInstrumentedMethod() {
counter++;
}
内容来源于网络,如有侵权,请联系作者删除!