本文整理汇总了Java中com.carrotsearch.junitbenchmarks.BenchmarkRule类的典型用法代码示例。如果您正苦于以下问题:Java BenchmarkRule类的具体用法?Java BenchmarkRule怎么用?Java BenchmarkRule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BenchmarkRule类属于com.carrotsearch.junitbenchmarks包,在下文中一共展示了BenchmarkRule类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: IndexGetChildsPerformanceTest
import com.carrotsearch.junitbenchmarks.BenchmarkRule; //导入依赖的package包/类
public IndexGetChildsPerformanceTest(int numItems, int numFiles) {
super(numItems, numFiles);
try {
benchmarkRun =
new BenchmarkRule(new CSVResultsConsumer((this.numItems * 5) + "," + this.numFiles, new FileWriter(
"get-childs_" + this.numFiles + ".csv", true)));
} catch(IOException e) {
e.printStackTrace();
}
index.reset();
for(int i = 0; i < this.numItems; ++i) {
add(def1, getNextFile());
add(def2, getNextFile());
add(def3, getNextFile());
add(use1, getNextFile());
add(type1, getNextFile());
}
}
示例2: IndexPersistPerformanceTest
import com.carrotsearch.junitbenchmarks.BenchmarkRule; //导入依赖的package包/类
public IndexPersistPerformanceTest(int numItems, int numFiles) {
super(numItems, numFiles);
try {
benchmarkRun =
new BenchmarkRule(new CSVResultsConsumer((this.numItems * 5) + "," + this.numFiles, new FileWriter(
"persist_" + this.numFiles + ".csv", true)));
} catch(IOException e) {
e.printStackTrace();
}
index.reset();
for(int i = 0; i < this.numItems; ++i) {
add(def1, getNextFile());
add(def2, getNextFile());
add(def3, getNextFile());
add(use1, getNextFile());
add(type1, getNextFile());
}
}
示例3: IndexGetKeyPartitionsPerformanceTest
import com.carrotsearch.junitbenchmarks.BenchmarkRule; //导入依赖的package包/类
public IndexGetKeyPartitionsPerformanceTest(int numItems, int numFiles) {
super(numItems, numFiles);
try {
benchmarkRun =
new BenchmarkRule(new CSVResultsConsumer((this.numItems * 5) + "," + this.numFiles, new FileWriter(
"get-key-partitions_" + this.numFiles + ".csv", true)));
} catch(IOException e) {
e.printStackTrace();
}
index.reset();
for(int i = 0; i < this.numItems; ++i) {
add(def1, getNextFile());
add(def2, getNextFile());
add(def3, getNextFile());
add(use1, getNextFile());
add(type1, getNextFile());
}
}
示例4: IndexGetPartitionsPerformanceTest
import com.carrotsearch.junitbenchmarks.BenchmarkRule; //导入依赖的package包/类
public IndexGetPartitionsPerformanceTest(int numItems, int numFiles) {
super(numItems, numFiles);
try {
benchmarkRun =
new BenchmarkRule(new CSVResultsConsumer((this.numItems * 5) + "," + this.numFiles, new FileWriter(
"get-partitions_" + this.numFiles + ".csv", true)));
} catch(IOException e) {
e.printStackTrace();
}
index.reset();
for(int i = 0; i < this.numItems; ++i) {
add(def1, getNextFile());
add(def2, getNextFile());
add(def3, getNextFile());
add(use1, getNextFile());
add(type1, getNextFile());
}
}
示例5: IndexGetPerformanceTest
import com.carrotsearch.junitbenchmarks.BenchmarkRule; //导入依赖的package包/类
public IndexGetPerformanceTest(int numItems, int numFiles) {
super(numItems, numFiles);
try {
benchmarkRun =
new BenchmarkRule(new CSVResultsConsumer((this.numItems * 5) + "," + this.numFiles, new FileWriter(
"get_" + this.numFiles + ".csv", true)));
} catch(IOException e) {
e.printStackTrace();
}
index.reset();
for(int i = 0; i < this.numItems; ++i) {
add(def1, getNextFile());
add(def2, getNextFile());
add(def3, getNextFile());
add(use1, getNextFile());
add(type1, getNextFile());
}
}
示例6: IndexGetPartitionElementsPerformanceTest
import com.carrotsearch.junitbenchmarks.BenchmarkRule; //导入依赖的package包/类
public IndexGetPartitionElementsPerformanceTest(int numItems, int numFiles) {
super(numItems, numFiles);
try {
benchmarkRun =
new BenchmarkRule(new CSVResultsConsumer((this.numItems * 5) + "," + this.numFiles, new FileWriter(
"get-partition-elems_" + this.numFiles + ".csv", true)));
} catch(IOException e) {
e.printStackTrace();
}
index.reset();
for(int i = 0; i < this.numItems; ++i) {
add(def1, getNextFile());
add(def2, getNextFile());
add(def3, getNextFile());
add(use1, getNextFile());
add(type1, getNextFile());
}
}
示例7: IndexCollectPerformanceTest
import com.carrotsearch.junitbenchmarks.BenchmarkRule; //导入依赖的package包/类
public IndexCollectPerformanceTest(int numItems, int numFiles) {
super(numItems, numFiles);
try {
benchmarkRun =
new BenchmarkRule(new CSVResultsConsumer((this.numItems * 5) + "," + this.numFiles, new FileWriter(
"collect_" + this.numFiles + ".csv", true)));
} catch(IOException e) {
e.printStackTrace();
}
index.reset();
}
示例8: IndexAddPerformanceTest
import com.carrotsearch.junitbenchmarks.BenchmarkRule; //导入依赖的package包/类
public IndexAddPerformanceTest(int numItems, int numFiles) {
super(numItems, numFiles);
try {
benchmarkRun =
new BenchmarkRule(new CSVResultsConsumer((this.numItems * 5) + "," + this.numFiles, new FileWriter(
"add_" + this.numFiles + ".csv", true)));
} catch(IOException e) {
e.printStackTrace();
}
index.reset();
}
示例9: IndexClearPerformanceTest
import com.carrotsearch.junitbenchmarks.BenchmarkRule; //导入依赖的package包/类
public IndexClearPerformanceTest(int numItemsPerFile, int numFiles) {
super(numItemsPerFile, numFiles);
this.fileIndexToClear = (int) Math.floor((double) this.numFiles / 2);
try {
benchmarkRun =
new BenchmarkRule(new CSVResultsConsumer((this.numItems * 5) + "," + this.numFiles, new FileWriter(
"clear_" + this.numFiles + ".csv", true)));
} catch(IOException e) {
e.printStackTrace();
}
}
示例10: AdjustableRoundsBenchmarkRule
import com.carrotsearch.junitbenchmarks.BenchmarkRule; //导入依赖的package包/类
public AdjustableRoundsBenchmarkRule(Map<String, Integer> efforts, IResultsConsumer... consumers) {
rule = new BenchmarkRule(consumers);
this.efforts = efforts;
}