本文整理汇总了Java中com.carrotsearch.junitbenchmarks.Result类的典型用法代码示例。如果您正苦于以下问题:Java Result类的具体用法?Java Result怎么用?Java Result使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Result类属于com.carrotsearch.junitbenchmarks包,在下文中一共展示了Result类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: visit
import com.carrotsearch.junitbenchmarks.Result; //导入依赖的package包/类
public void visit(Class<?> clazz, Method method, Result result)
{
boolean onMethod = method != null && method.isAnnotationPresent(BenchmarkHistoryChart.class);
boolean onClass = clazz.isAnnotationPresent(BenchmarkHistoryChart.class);
if (onMethod || onClass)
{
if (!types.containsKey(clazz))
{
types.put(clazz, new ArrayList<Method>());
}
if (onMethod)
{
types.get(clazz).add(method);
}
}
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:19,代码来源:HistoryChartVisitor.java
示例2: visit
import com.carrotsearch.junitbenchmarks.Result; //导入依赖的package包/类
public void visit(Class<?> clazz, Method method, Result result)
{
if (clazz.isAnnotationPresent(BenchmarkMethodChart.class)
&& !types.contains(clazz))
{
types.add(clazz);
}
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:9,代码来源:MethodChartVisitor.java
示例3: accept
import com.carrotsearch.junitbenchmarks.Result; //导入依赖的package包/类
/**
* Accept a single benchmark result.
*/
@Override
public void accept(Result result)
{
// Visit chart collectors.
final Class<?> clazz = result.getTestClass();
final Method method = result.getTestMethod();
for (IChartAnnotationVisitor v : chartVisitors)
{
v.visit(clazz, method, result);
}
try
{
PreparedStatement testInsertStatement = getTestInsertStatement();
testInsertStatement.setString(CLASSNAME, result.getTestClassName());
testInsertStatement.setString(NAME, result.getTestMethodName());
testInsertStatement.setInt(BENCHMARK_ROUNDS, result.benchmarkRounds);
testInsertStatement.setInt(WARMUP_ROUNDS, result.warmupRounds);
testInsertStatement.setDouble(ROUND_AVG, result.roundAverage.avg);
testInsertStatement.setDouble(ROUND_STDDEV, result.roundAverage.stddev);
testInsertStatement.setDouble(GC_AVG, result.gcAverage.avg);
testInsertStatement.setDouble(GC_STDDEV, result.gcAverage.stddev);
testInsertStatement.setInt(GC_INVOCATIONS, (int) result.gcInfo.accumulatedInvocations());
testInsertStatement.setDouble(GC_TIME, result.gcInfo.accumulatedTime() / 1000.0);
testInsertStatement.setDouble(TIME_WARMUP, result.warmupTime / 1000.0);
testInsertStatement.setDouble(TIME_BENCHMARK, result.benchmarkTime / 1000.0);
testInsertStatement.executeUpdate();
}
catch (SQLException e)
{
throw new RuntimeException("Error while saving the benchmark result to H2.", e);
}
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:36,代码来源:DbConsumer.java
示例4: accept
import com.carrotsearch.junitbenchmarks.Result; //导入依赖的package包/类
@Override
public void accept(Result result) throws IOException {
// Result's javadoc says roundAvg.avg is ms, but it seems to be s in reality
double millis = 1000D * result.roundAverage.avg;
double scalar = Math.max(1D, TARGET_RUNTIME_MS / Math.max(1D, millis));
String testClass = result.getTestClassName();
String testName = result.getTestMethodName();
writer.write(String.format("%s.%s %.3f%n", testClass, testName, scalar));
writer.flush();
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:13,代码来源:JUnitBenchmarkProvider.java
示例5: accept
import com.carrotsearch.junitbenchmarks.Result; //导入依赖的package包/类
public synchronized void accept(Result r) throws IOException {
Joiner j = Joiner.on(separator);
List<String> fields = new ArrayList<String>(Column.values().length);
for (Column c : Column.values()) {
fields.add(c.get(r));
}
csv.write(String.format("%s%n", j.join(fields)));
log.debug("Wrote {} to {}", r, csvFile);
csv.flush();
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:11,代码来源:CsvConsumer.java
示例6: accept
import com.carrotsearch.junitbenchmarks.Result; //导入依赖的package包/类
public void accept(Result result) throws IOException {
String line =
String.format(Locale.ROOT, "%s,%f,%f,%f,%f,%d,%d,%d,%d,%d,%d%n", prefixCSV, result.roundAverage.avg,
result.roundAverage.stddev, result.gcAverage.avg, result.gcAverage.stddev,
result.gcInfo.accumulatedInvocations(), result.gcInfo.accumulatedTime(), result.benchmarkRounds,
result.benchmarkTime, result.warmupRounds, result.warmupTime);
System.out.print(line);
writer.write(line);
writer.flush();
writer.close();
}
开发者ID:metaborg,项目名称:mb-rep,代码行数:12,代码来源:CSVResultsConsumer.java
示例7: accept
import com.carrotsearch.junitbenchmarks.Result; //导入依赖的package包/类
public void accept(Result result)
{
results.put(result.getTestMethodName(), result);
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:5,代码来源:TestClock.java
示例8: get
import com.carrotsearch.junitbenchmarks.Result; //导入依赖的package包/类
@Override public String get(Result r) {
return r.getShortTestClassName();
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:4,代码来源:CsvConsumer.java
注:本文中的com.carrotsearch.junitbenchmarks.Result类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论