public static byte[] generateData(int length) {
    byte[] b = new byte[length];
    int i;

    Random r = ThreadLocalRandom.current();
    for (i = 0; i < (length - 8); i += 8) {
      b[i] = (byte) (65 + r.nextInt(26));
      b[i + 1] = b[i];
      b[i + 2] = b[i];
      b[i + 3] = b[i];
      b[i + 4] = b[i];
      b[i + 5] = b[i];
      b[i + 6] = b[i];
      b[i + 7] = b[i];
    }

    byte a = (byte) (65 + r.nextInt(26));
    for (; i < length; i++) {
      b[i] = a;
    }
    return b;
  }
Compute a throughput rate in MB/s.
@param rows   Number of records consumed.
@param timeMs Time taken in milliseconds.
@return String value with label, ie '123.76 MB/s'
hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/PerformanceEvaluation.java