@Override
  public void runTest(String name, String fname, String fpath) {
    long startTime = System.currentTimeMillis();
    try {
      LOG.info("Begin query: " + fname);

      qt.setInputFile(fpath);
      qt.cliInit();

      try {
        qt.executeClient();
      } catch (CommandProcessorException e) {
        qt.failedQuery(e.getCause(), e.getResponseCode(), fname, QTestUtil.DEBUG_HINT);
      }

      QTestProcessExecResult result = qt.checkCliDriverResults();
      if (result.getReturnCode() != 0) {
        String message = Strings.isNullOrEmpty(result.getCapturedOutput()) ? QTestUtil.DEBUG_HINT :
            "\r\n" + result.getCapturedOutput();
        qt.failedDiff(result.getReturnCode(), fname, message);
      }
    } catch (AssumptionViolatedException e) {
      throw e;
    } catch (Exception e) {
      qt.failedWithException(e, fname, QTestUtil.DEBUG_HINT);
    }

    long elapsedTime = System.currentTimeMillis() - startTime;
    LOG.info("Done query: " + fname + " elapsedTime=" + elapsedTime / 1000 + "s");
  }
CliDriver for integrating performance regression tests as part of the Hive Unit tests.

Typically it is meant to be combined with configurations providing an initialised metastore and read-only queries.
itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CorePerfCliDriver.java