本文整理汇总了Java中org.openjdk.jmh.annotations.Level.Trial方法的典型用法代码示例。如果您正苦于以下问题:Java Level.Trial方法的具体用法?Java Level.Trial怎么用?Java Level.Trial使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openjdk.jmh.annotations.Level
的用法示例。
在下文中一共展示了Level.Trial方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Trial)
public void setup() {
chunkStore = new ChunkImpl(
new MetricsAndTagStoreImpl(new InvertedIndexTagStore(1_000_000, 1_000_000), new VarBitMetricStore()), null);
try (Stream<String> lines = Files.lines(filePath, Charset.defaultCharset())) {
lines.forEachOrdered(line -> {
try {
String[] words = line.split(" ");
String metricName = words[1];
if (counts.containsKey(metricName)) {
counts.put(metricName, counts.get(metricName) + 1);
} else {
counts.put(metricName, 1);
}
MetricUtils.parseAndAddOpenTsdbMetric(line, chunkStore);
} catch (Exception e) {
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
示例2: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Trial)
public void setup() throws IOException {
indexMemCache = new IndexExpiredMemCache(TimeUnit.MINUTES.toMillis(10), 1000 * 1024 * 1024);
packMemCache = new PackExpiredMemCache(TimeUnit.MINUTES.toMillis(10), 1000 * 1024 * 1024);
workDir = Files.createTempDirectory("dpsegment_bm_");
String segmentId = "test_segment";
DPSegment insertSegment = DPSegment.open(Version.LATEST_ID, SegmentMode.DEFAULT, workDir, segmentId, segmentSchema, OpenOption.Overwrite).update();
addRows(insertSegment, genRows(rowCount));
insertSegment.seal();
IntegratedSegment.Fd.create(
insertSegment,
workDir.resolve("integreated"),
false);
IntegratedSegment.Fd fd = IntegratedSegment.Fd.create("aa", workDir.resolve("integreated"));
segment = (IntegratedSegment) fd.open(indexMemCache, null, packMemCache);
// warm up.
travel_stream_forEach();
travel_by_pack();
}
示例3: setupTrial
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
/**
* Ensures Accumulo and the test are ready.
*/
@Setup(Level.Trial)
public void setupTrial() throws Exception {
AccumuloInstance.setup();
connector = AccumuloInstance.getConnector(USER_NAME);
User user = AccumuloInstance.getUser(USER_NAME);
authorizations = user.authorizations;
encryptionKeys = user.encryptionKeys;
signatureKeys = user.signatureKeys;
for (String table : tables) {
AccumuloInstance.createTable(table);
}
}
示例4: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Trial)
public void setup() {
ThreadLocalRandom random = ThreadLocalRandom.current();
input = random.longs(0, 10000).limit(10000).toArray();
output = new long[input.length];
compressed = new long[input.length];
amount = Simple8RLE.compress(input, compressed);
decompressed = new long[input.length];
}
示例5: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Trial)
public void setup(BenchmarkParams params) throws Exception
{
DS = ManagedDataSourceBuilder.builder()
.dataSource(new StubDataSource())
.userName("gnodet")
.password("")
.transaction(TransactionSupport.TransactionSupportLevel.NoTransaction)
.minIdle(0)
.maxPoolSize(maxPoolSize)
.connectionTimeout(8000)
.build();
}
示例6: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Trial)
public void setup() {
ChunkManager chunkManager = new ChunkManager("test", 1_000_000);
metricWriter = new FileMetricWriter(filePath, chunkManager);
metricWriter.start();
// Convert all data to offHeap
chunkManager.toOffHeapChunkMap();
}
示例7: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Trial)
public void setup() {
chunkStore = new ChunkImpl(
new MetricsAndTagStoreImpl(new InvertedIndexTagStore(1_000_000, 1_000_000), new VarBitMetricStore()),
null);
try (Stream<String> lines = Files.lines(filePath, Charset.defaultCharset())) {
lines.forEachOrdered(line -> {
try {
String[] words = line.split(" ");
String metricName = words[1];
if (metricName != null && !metricName.isEmpty()) {
if (counts.containsKey(metricName)) {
counts.put(metricName, counts.get(metricName) + 1);
} else {
counts.put(metricName, 1);
}
MetricUtils.parseAndAddOpenTsdbMetric(line, chunkStore);
}
} catch (Exception e) {
System.err.println("Error ingesting metric: " + e.getMessage());
e.printStackTrace();
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
示例8: doSetup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Trial)
public void doSetup() {
try {
intValField = Foo.class.getDeclaredField("intVal");
intValField.setAccessible(true);
} catch (NoSuchFieldException | SecurityException e) {
throw new RuntimeException(e);
}
}
示例9: setupGraph
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
/**
* No need to rebuild the graph for every invocation since it is not altered by the backend.
*/
@Setup(Level.Trial)
public void setupGraph() {
initializeMethod();
prepareRequest();
emitFrontEnd();
}
示例10: beforeBenchmark
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Trial)
public void beforeBenchmark() {
// setup graph
initializeMethod();
prepareRequest();
emitFrontEnd();
generateLIR();
// compute cfg
this.cfg = (ControlFlowGraph) getLIR().getControlFlowGraph();
}
示例11: teardownTrial
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
/**
* Ensures Accumulo and test are cleaned up.
*/
@TearDown(Level.Trial)
public void teardownTrial() throws Exception {
for (String table : tables) {
AccumuloInstance.deleteTable(table);
}
AccumuloInstance.teardown();
}
示例12: setUp
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Override
@Setup(Level.Trial)
public void setUp() throws Exception {
final String name = "DS_BENCHMARK";
final ExecutorService dataChangeListenerExecutor = SpecialExecutors.newBlockingBoundedFastThreadPool(
MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE, MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE, name + "-DCL");
domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", dataChangeListenerExecutor);
schemaContext = BenchmarkModel.createTestContext();
domStore.onGlobalContextUpdated(schemaContext);
initTestNode();
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:13,代码来源:InMemoryDataStoreWithSameThreadedExecutorBenchmark.java
示例13: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Trial)
public void setup() {
reporter = AsyncReporter.builder(new NoopSender(encoding))
.messageMaxBytes(1000000) // example default from Kafka message.max.bytes
.metrics(metrics)
.build();
}
示例14: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Trial)
public void setup() throws Throwable {
sender = createSender();
CheckResult senderCheck = sender.check();
if (!senderCheck.ok()) throw new IllegalStateException("sender not ok", senderCheck.error());
reporter = (AsyncReporter.BoundedAsyncReporter<Span>) AsyncReporter.builder(sender)
.messageMaxBytes(messageMaxBytes)
.queuedMaxSpans(TARGET_BACKLOG)
.metrics(metrics).build();
}
示例15: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Trial)
public void setup() throws Exception {
if (array == null) {
array = new int[size];
slice = ByteSlice.allocateDirect(size << 2);
} else {
throw new RuntimeException("hhhh");
}
for (int i = 0; i < size; i++) {
array[i] = i;
slice.putInt(i << 2, i);
}
}