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

Java Result类代码示例

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

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java TestRunnerUtil类代码示例发布时间:2022-05-22
下一篇:
Java IInformationPresenter类代码示例发布时间: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