有一个错误,JMH没有把我的班级提升到基准.
package com.stecurran.jmh.entry; import org.openjdk.jmh.Main; public class JmhRunner { private static final String TEST = "com.stecurra.benchmark.strategy.EventRunner"; public static void main(String[] args) { Main.main(getArguments(TEST, 5, 5000, 1)); } private static String[] getArguments(String className, int nRuns, int runForMilliseconds, int nThreads) { return new String[] { className, "-i", "" + nRuns, "-r", runForMilliseconds + "ms", "-t", "" + nThreads, "-w", "5000ms", "-wi", "3", "-v" }; } }
EventRunner包含的位置:
package com.stecurra.benchmark.strategy; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.GenerateMicroBenchmark; import org.openjdk.jmh.annotations.Mode; @BenchmarkMode(Mode.AverageTime) public class EventRunner { @GenerateMicroBenchmark public void runTest(){ TimeStore.start = System.nanoTime(); // FacebookRetriever fbCal = FacebookRetriever.getInstance(); GoogleRetriever gCal = GoogleRetriever.getInstance(); CalendarService cs = new CalendarService(gCal); for (SimpleEvent simpleEvent : cs.getEvents()) { System.out.println(simpleEvent); } TimeStore.end = System.nanoTime(); System.out.println(TimeStore.getTime()); } }
我收到这个错误:
不包括:org.sample.MyBenchmark.testMethod,与com.stecurra.benchmark.strategy.EventRunner不匹配没有匹配的基准测试.拼写错误的正则表达式?使用-v表示详细输出.
如何更改我的正则表达式有效?
谢谢