private void runAcidBenchmarks() {
    ChainedOptionsBuilder optsBuilder =
        new OptionsBuilder()
            .warmupIterations(warmup)
            .measurementIterations(spinCount)
            .operationsPerInvocation(1)
            .mode(Mode.SingleShotTime)
            .timeUnit(TimeUnit.MILLISECONDS)
            .forks(0)
            .threads(nThreads)
            .syncIterations(true);

    String[] candidates = new String[] {
        ACIDBenchmarks.TestOpenTxn.class.getSimpleName(),
        ACIDBenchmarks.TestLocking.class.getSimpleName(),
        ACIDBenchmarks.TestGetValidWriteIds.class.getSimpleName(),
        ACIDBenchmarks.TestAllocateTableWriteIds.class.getSimpleName()
    };

    for (String pattern : Util.filterMatches(Arrays.asList(candidates), matches, exclude)) {
      optsBuilder = optsBuilder.include(pattern);
    }

    Options opts =
        optsBuilder
            .param("howMany", Arrays.stream(instances)
            .mapToObj(String::valueOf)
                .toArray(String[]::new))
            .param("nPartitions", Arrays.stream(nParameters)
                .mapToObj(String::valueOf).toArray(String[]::new))
            .build();

    try {
      new Runner(opts).run();
    } catch (RunnerException e) {
      LOG.error(e.getMessage(), e);
    }
  }
Command-line access to Hive Metastore.
standalone-metastore/metastore-tools/metastore-benchmarks/src/main/java/org/apache/hadoop/hive/metastore/tools/BenchmarkTool.java