本文整理汇总了Java中com.google.caliper.api.SkipThisScenarioException类的典型用法代码示例。如果您正苦于以下问题:Java SkipThisScenarioException类的具体用法?Java SkipThisScenarioException怎么用?Java SkipThisScenarioException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SkipThisScenarioException类属于com.google.caliper.api包,在下文中一共展示了SkipThisScenarioException类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setUp
import com.google.caliper.api.SkipThisScenarioException; //导入依赖的package包/类
@BeforeExperiment void setUp() {
if (emptySetProportion + singletonSetProportion > 1.01) {
throw new SkipThisScenarioException();
}
Random rng = new Random();
for (int i = 0; i < 0x1000; i++) {
double setSize = rng.nextDouble();
if (setSize < emptySetProportion) {
sets[i] = ImmutableSet.of();
} else if (setSize < emptySetProportion + singletonSetProportion) {
sets[i] = ImmutableSet.of(PRESENT);
} else {
sets[i] = ImmutableSet.of(PRESENT, new Object());
}
if (rng.nextDouble() < hitRate) {
queries[i] = PRESENT;
} else {
queries[i] = ABSENT;
}
}
}
开发者ID:zugzug90,项目名称:guava-mock,代码行数:24,代码来源:MultipleSetContainsBenchmark.java
示例2: setUp
import com.google.caliper.api.SkipThisScenarioException; //导入依赖的package包/类
@BeforeExperiment
void setUp() {
if (emptySetProportion + singletonSetProportion > 1.01) {
throw new SkipThisScenarioException();
}
Random rng = new Random();
for (int i = 0; i < 0x1000; i++) {
double setSize = rng.nextDouble();
if (setSize < emptySetProportion) {
sets[i] = ImmutableSet.of();
} else if (setSize < emptySetProportion + singletonSetProportion) {
sets[i] = ImmutableSet.of(PRESENT);
} else {
sets[i] = ImmutableSet.of(PRESENT, new Object());
}
if (rng.nextDouble() < hitRate) {
queries[i] = PRESENT;
} else {
queries[i] = ABSENT;
}
}
}
开发者ID:google,项目名称:guava,代码行数:25,代码来源:MultipleSetContainsBenchmark.java
示例3: doBefore
import com.google.caliper.api.SkipThisScenarioException; //导入依赖的package包/类
@BeforeExperiment
public void doBefore() {
recursionCount = stackDepth - new Throwable().getStackTrace().length - 1;
if (recursionCount < 0) {
throw new SkipThisScenarioException();
}
}
开发者ID:zugzug90,项目名称:guava-mock,代码行数:8,代码来源:LazyStackTraceBenchmark.java
示例4: variance
import com.google.caliper.api.SkipThisScenarioException; //导入依赖的package包/类
@Override
MeanAndVariance variance(double[] values, MeanAlgorithm meanAlgorithm) {
if (meanAlgorithm != MeanAlgorithm.KNUTH) {
throw new SkipThisScenarioException();
}
double mean = values[0];
double s = 0.0;
for (int i = 1; i < values.length; i++) {
double nextMean = mean + (values[i] - mean) / (i + 1);
s += (values[i] - mean) * (values[i] - nextMean);
mean = nextMean;
}
return new MeanAndVariance(mean, s / values.length);
}
开发者ID:zugzug90,项目名称:guava-mock,代码行数:15,代码来源:StatsBenchmark.java
示例5: operate
import com.google.caliper.api.SkipThisScenarioException; //导入依赖的package包/类
@Override
Object operate(Stream<?> stream) {
try {
return stream.collect(MoreCollectors.onlyElement());
} catch (IllegalArgumentException | NoSuchElementException e) {
throw new SkipThisScenarioException();
}
}
开发者ID:zugzug90,项目名称:guava-mock,代码行数:9,代码来源:StreamsBenchmark.java
示例6: setUp
import com.google.caliper.api.SkipThisScenarioException; //导入依赖的package包/类
@BeforeExperiment void setUp() throws Exception {
if (state != State.NOT_DONE && (numListeners != 0 || numThreads != 0)) {
throw new SkipThisScenarioException();
}
}
开发者ID:zugzug90,项目名称:guava-mock,代码行数:6,代码来源:AbstractFutureFootprintBenchmark.java
示例7: setUp
import com.google.caliper.api.SkipThisScenarioException; //导入依赖的package包/类
@BeforeExperiment
void setUp() throws Exception {
if (state != State.NOT_DONE && (numListeners != 0 || numThreads != 0)) {
throw new SkipThisScenarioException();
}
}
开发者ID:google,项目名称:guava,代码行数:7,代码来源:AbstractFutureFootprintBenchmark.java
注:本文中的com.google.caliper.api.SkipThisScenarioException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论