有一个错误,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 进行详细输出。
如何将我的正则表达式更改为有效?
谢谢