@Override
    public void run() {
      ThreadLocalRandom random = ThreadLocalRandom.current();
      try {
        for (long l = 0; l < numberOfPuts; l++) {
          NamedBlobRecord record = generateRandomNamedBlobRecord(random, accountService, allAccounts);
          namedBlobDb.put(record, NamedBlobState.IN_PROGRESS, true).get();
          allRecords.add(record);
        }
        System.out.println("PerformanceTestWorker " + id + " finishes writing " + numberOfPuts + " records");

        for (NamedBlobRecord record : allRecords) {
          namedBlobDb.updateBlobTtlAndStateToReady(record).get();
        }
        System.out.println("PerformanceTestWorker " + id + " finishes updating " + numberOfPuts + " records");

        for (NamedBlobRecord record : allRecords) {
          namedBlobDb.get(record.getAccountName(), record.getContainerName(), record.getBlobName()).get();
        }
        System.out.println("PerformanceTestWorker " + id + " finishes reading " + numberOfPuts + " records");

        if (includeList) {
          int numberOfList = 0;
          for (NamedBlobRecord record : allRecords) {
            if (!record.getAccountName().equals(String.format(ACCOUNT_NAME_FORMAT, HUGE_LIST_ACCOUNT_ID))) {
              namedBlobDb.list(record.getAccountName(), record.getContainerName(), "A", null, null).get();
              numberOfList++;
              if (numberOfList == 100) {
                break;
              }
            }
          }
          System.out.println("PerformanceTestWorker " + id + " finishes listing for records");

          String accountName = String.format(ACCOUNT_NAME_FORMAT, HUGE_LIST_ACCOUNT_ID);
          String containerName = String.format(CONTAINER_NAME_FORMAT, HUGE_LIST_CONTAINER_ID);
          String token = null;
          for (int i = 0; i < 100; i++) {
            token = namedBlobDb.list(accountName, containerName, HUGE_LIST_COMMON_PREFIX, token, null)
                .get()
                .getNextPageToken();
          }
          System.out.println("PerformanceTestWorker " + id + " finishes listing for huge records");
        }

        for (NamedBlobRecord record : allRecords) {
          namedBlobDb.delete(record.getAccountName(), record.getContainerName(), record.getBlobName()).get();
        }
        System.out.println("PerformanceTestWorker " + id + " finishes deleting " + numberOfPuts + " records");
      } catch (Exception e) {
        System.out.println("PerformanceTestWorker " + id + " has som exception " + e);
      }
    }
This class is the worker class that carries out the performance tests.
There are several tests to be done in this worker
1. Put, with isUpsert to be true, otherwise, a put operation would run a select and insert query.
2. Update, update the state for each named blob record
3. Get, with all the named blob records that are just inserted
4. Delete, delete is actually an update as well.
5. List, list a small named blob sets and a huge named blob sets
ambry-tools/src/main/java/com/github/ambry/tools/perf/NamedBlobMysqlDatabasePerf.java