public void run() {
      try {
        System.out.println("Starting write index performance");
        System.out.flush();
        while (!isShutdown.get()) {

          // choose a random index
          int indexToUse = new Random().nextInt(indexesWithMetrics.size());
          // Does not matter what partition we use
          PartitionId partition = map.getWritablePartitionIds(null).get(0);
          indexesWithMetrics.get(indexToUse)
              .addToIndexRandomData(new BlobId(blobIdVersion, BlobId.BlobIdType.NATIVE, map.getLocalDatacenterId(),
                  Account.UNKNOWN_ACCOUNT_ID, Container.UNKNOWN_CONTAINER_ID, partition, false,
                  BlobId.BlobDataType.DATACHUNK));
          throttler.maybeThrottle(1);
        }
      } catch (Exception e) {
        System.out.println("Exiting write index perf thread " + e);
      } finally {
        latch.countDown();
      }
    }
Tests the memory boundaries and latencies of the index structure
during writes
ambry-tools/src/main/java/com/github/ambry/store/IndexWritePerformance.java