当前位置: 首页>>代码示例>>Java>>正文


Java Level类代码示例

本文整理汇总了Java中org.openjdk.jmh.annotations.Level的典型用法代码示例。如果您正苦于以下问题:Java Level类的具体用法?Java Level怎么用?Java Level使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Level类属于org.openjdk.jmh.annotations包,在下文中一共展示了Level类的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();
  }
}
 
开发者ID:pinterest,项目名称:yuvi,代码行数:25,代码来源:OffHeapVarBitMetricStoreBuildBenchmark.java

示例2: setUp

import org.openjdk.jmh.annotations.Level; //导入依赖的package包/类
@Setup(Level.Trial)
@Override
public void setUp() throws Exception {
    ListeningExecutorService dsExec = MoreExecutors.newDirectExecutorService();
    executor = MoreExecutors.listeningDecorator(
            MoreExecutors.getExitingExecutorService((ThreadPoolExecutor) Executors.newFixedThreadPool(1), 1L,
                    TimeUnit.SECONDS));

    InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", dsExec);
    InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", dsExec);
    Map<LogicalDatastoreType, DOMStore> datastores = ImmutableMap.of(
        LogicalDatastoreType.OPERATIONAL, (DOMStore)operStore,
        LogicalDatastoreType.CONFIGURATION, configStore);

    domBroker = new SerializedDOMDataBroker(datastores, executor);
    schemaContext = BenchmarkModel.createTestContext();
    configStore.onGlobalContextUpdated(schemaContext);
    operStore.onGlobalContextUpdated(schemaContext);
    initTestNode();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:21,代码来源:InMemoryBrokerWriteTransactionBenchmark.java

示例3: 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();
}
 
开发者ID:shunfei,项目名称:indexr,代码行数:25,代码来源:SegmentBenchmark.java

示例4: generateData

import org.openjdk.jmh.annotations.Level; //导入依赖的package包/类
@Setup(Level.Trial)
public void generateData() {
    array = new int[chunksCount][];
    int remaining = chunksCount;
    Random rnd = new Random(1);
    while(remaining > 0) {
        int n = rnd.nextInt(chunksCount);
        if (array[n] == null) {
            --remaining;
            int[] chunk = new int[chunkSize / 2 + rnd.nextInt(chunkSize)];
            array[n] = chunk;
            for(int i = 0; i != chunk.length; ++i) {
                array[n][i] = rnd.nextInt();
            }
            Arrays.sort(array[n]);
            int b1 = Arrays.binarySearch(chunk, 0);
            int b2 = Arrays.binarySearch(chunk, chunk[chunk.length / 2]);
            int s1 = lookup(chunk, 0);
            int s2 = lookup(chunk, chunk[chunk.length / 2]);
            if (b1 != s1 || b2 != s2) {
                throw new IllegalArgumentException("Verification have failed");
            }
        }
    }        
}
 
开发者ID:aragozin,项目名称:pds4j,代码行数:26,代码来源:AbstractSearchN.java

示例5: start

import org.openjdk.jmh.annotations.Level; //导入依赖的package包/类
@Setup(Level.Iteration)
public void start() {
    counter = 0;
    if (log == null) {
        com.comfortanalytics.alog.Alog.DEFAULT_MAX_QUEUE = -1; //ignore no messages
        log = com.comfortanalytics.alog.Alog.getLogger(
                "Alog", new PrintStream(new NullOutputStream()));
        log.getHandlers()[0].setFormatter(new SimpleFormatter());
        log.setUseParentHandlers(false);
    }
}
 
开发者ID:a-hansen,项目名称:alog,代码行数:12,代码来源:AlogBenchmark.java

示例6: 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();
}
 
开发者ID:ops4j,项目名称:org.ops4j.pax.transx,代码行数:14,代码来源:BenchBase.java

示例7: 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();
}
 
开发者ID:pinterest,项目名称:yuvi,代码行数:9,代码来源:ChunkManagerQueryBenchmark.java

示例8: 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();
  }
}
 
开发者ID:pinterest,项目名称:yuvi,代码行数:30,代码来源:ChunkQueryBenchmark.java

示例9: setup

import org.openjdk.jmh.annotations.Level; //导入依赖的package包/类
@Setup(Level.Invocation)
public void setup() {
  switch (msType) {
    case "InvertedIndexTagStore":
      int initialMapSize = 10000;
      ms = new InvertedIndexTagStore(initialMapSize, initialMapSize);
      metrics = new ArrayList();
      for (int i = 0; i < initialMapSize; i++) {
        metrics.add(randomMetric(numMetrics, numKeys, numValues));
      }
      break;
    default:
      throw new RuntimeException("invalid msType: " + msType);
  }
}
 
开发者ID:pinterest,项目名称:yuvi,代码行数:16,代码来源:InvertedIndexTagStoreBenchmark.java

示例10: 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();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:GraalCompilerState.java

示例11: 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();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:ControlFlowGraphState.java

示例12: setup

import org.openjdk.jmh.annotations.Level; //导入依赖的package包/类
@Setup(Level.Trial)
public void setup() {
    initializeMethod();
    prepareRequest();
    emitFrontEnd();
    generateLIR();
    preAllocationStage();
    // context for all allocation phases
    allocationContext = createAllocationContext();
    applyLIRPhase(TRACE_BUILDER_PHASE, allocationContext);
    applyLIRPhase(LIVENESS_ANALYSIS_PHASE, allocationContext);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:TraceLSRAIntervalBuildingBench.java

示例13: afterInvocation

import org.openjdk.jmh.annotations.Level; //导入依赖的package包/类
@TearDown(Level.Invocation)
public void afterInvocation() {
    if (invocation == 0) {
        // Only need to check the first invocation
        invocation++;
        for (int i = 0; i < nodes.length; i++) {
            if (nodes[i] != originalNodes[i]) {
                throw new InternalError(String.format("Benchmark method mutated node %d: original=%s, current=%s", i, originalNodes[i], nodes[i]));
            }
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:NodesState.java

示例14: 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);
	}
}
 
开发者ID:Javalbert,项目名称:faster-than-reflection,代码行数:10,代码来源:FasterThanReflectionBenchmark.java

示例15: 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);
  }
}
 
开发者ID:mit-ll,项目名称:PACE,代码行数:18,代码来源:BenchmarkBase.java


注:本文中的org.openjdk.jmh.annotations.Level类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。