本文整理汇总了Java中com.google.caliper.Scenario类的典型用法代码示例。如果您正苦于以下问题:Java Scenario类的具体用法?Java Scenario怎么用?Java Scenario使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Scenario类属于com.google.caliper包,在下文中一共展示了Scenario类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: appendTo
import com.google.caliper.Scenario; //导入依赖的package包/类
/**
* Attach this measure to parent caliper run.
*/
public void appendTo(final Run run) {
final Scenario scenario = new Scenario(variables());
/** display rate as caliper durations */
final MeasurementSet timeSet = measurementSet(rateMap);
final String timeLog = null;
/** display time as caliper instances */
final MeasurementSet instSet = measurementSet(timeMap);
final String instLog = null;
/** display size as caliper memory */
final MeasurementSet heapSet = measurementSet(sizeMap);
final String heapLog = null;
final ScenarioResult scenarioResult = new ScenarioResult(timeSet,
timeLog, instSet, instLog, heapSet, heapLog);
final Map<Scenario, ScenarioResult> measurements = run
.getMeasurements();
measurements.put(scenario, scenarioResult);
}
示例2: newRun
import com.google.caliper.Scenario; //导入依赖的package包/类
/**
* Provide new named run instance.
*/
public static Run newRun(final String benchmarkName) {
final Map<Scenario, ScenarioResult> measurements = new HashMap<Scenario, ScenarioResult>();
final Date executedTimestamp = new Date();
final Run run = new Run(measurements, benchmarkName, executedTimestamp);
return run;
}
示例3: newRun
import com.google.caliper.Scenario; //导入依赖的package包/类
/**
* Provide new named run instance.
*/
public static Run newRun(final String benchmarkName) {
final Map<Scenario, ScenarioResult> measurements = new HashMap<Scenario, ScenarioResult>();
final Date executedTimestamp = new Date();
return new Run(measurements, benchmarkName, executedTimestamp);
}