@Override
  protected int doWork() throws Exception {
    procedureScheduler = new MasterProcedureScheduler(pid -> null);
    procedureScheduler.start();
    setupOperations();

    final Thread[] threads = new Thread[numThreads];
    for (int i = 0; i < numThreads; ++i) {
      threads[i] = new AddProcsWorker();
    }
    final long addBackTime = runThreads(threads);
    System.out.println("Added " + numOps + " procedures to scheduler.");

    for (int i = 0; i < numThreads; ++i) {
      threads[i] = new PollAndLockWorker();
    }
    final long pollTime = runThreads(threads);
    procedureScheduler.stop();

    final float pollTimeSec = pollTime / 1000.0f;
    final float addBackTimeSec = addBackTime / 1000.0f;
    System.out.println("******************************************");
    System.out.println("Time - addBack     : " + StringUtils.humanTimeDiff(addBackTime));
    System.out.println("Ops/sec - addBack  : " + StringUtils.humanSize(numOps / addBackTimeSec));
    System.out.println("Time - poll        : " + StringUtils.humanTimeDiff(pollTime));
    System.out.println("Ops/sec - poll     : " + StringUtils.humanSize(numOps / pollTimeSec));
    System.out.println("Num Operations     : " + numOps);
    System.out.println();
    System.out.println("Completed          : " + completed.get());
    System.out.println("Yield              : " + yield.get());
    System.out.println();
    System.out.println("Num Tables         : " + numTables);
    System.out.println("Regions per table  : " + regionsPerTable);
    System.out.println("Operations type    : " + opsType);
    System.out.println("Threads            : " + numThreads);
    System.out.println("******************************************");
    System.out.println("Raw format for scripts");
    System.out.println(String.format(
      "RESULT [%s=%s, %s=%s, %s=%s, %s=%s, %s=%s, "
        + "num_yield=%s, time_addback_ms=%s, time_poll_ms=%s]",
      NUM_OPERATIONS_OPTION.getOpt(), numOps, OPS_TYPE_OPTION.getOpt(), opsType,
      NUM_TABLES_OPTION.getOpt(), numTables, REGIONS_PER_TABLE_OPTION.getOpt(), regionsPerTable,
      NUM_THREADS_OPTION.getOpt(), numThreads, yield.get(), addBackTime, pollTime));
    return 0;
  }
Starts the threads and waits for them to finish.
@return time taken by threads to complete, in milliseconds.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureSchedulerPerformanceEvaluation.java