@Override
    public void run() {
      byte[] key = new byte[keySize];
      byte[] value = new byte[valueSize];
      WAL wal = region.getWAL();
      Span threadSpan = TraceUtil.getGlobalTracer()
        .spanBuilder("WALPerfEval." + Thread.currentThread().getName()).startSpan();
      try (Scope threadScope = threadSpan.makeCurrent()) {
        int lastSync = 0;
        for (int i = 0; i < numIterations; ++i) {
          assert Span.current() == threadSpan : "Span leak detected.";
          Span loopSpan = TraceUtil.getGlobalTracer().spanBuilder("runLoopIter" + i).startSpan();
          try (Scope loopScope = loopSpan.makeCurrent()) {
            long now = System.nanoTime();
            Put put = setupPut(ThreadLocalRandom.current(), key, value, numFamilies);
            WALEdit walEdit = new WALEdit();
            walEdit.addMap(ClientInternalHelper.getExtendedFamilyCellMap(put));
            RegionInfo hri = region.getRegionInfo();
            final WALKeyImpl logkey =
              new WALKeyImpl(hri.getEncodedNameAsBytes(), hri.getTable(), now, mvcc, scopes);
            wal.appendData(hri, logkey, walEdit);
            if (!this.noSync) {
              if (++lastSync >= this.syncInterval) {
                wal.sync();
                lastSync = 0;
              }
            }
            latencyHistogram.update(System.nanoTime() - now);
          } finally {
            loopSpan.end();
          }
        }
      } catch (IOException e) {
        LOG.error(getClass().getSimpleName() + " Thread failed", e);
      } finally {
        threadSpan.end();
      }
    }
Perform WAL.append() of Put object, for the number of iterations requested. Keys and Vaues are
generated randomly, the number of column families, qualifiers and key/value size is tunable by
the user.
hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/wal/WALPerformanceEvaluation.java