@Override
  public CompletableFuture<Integer> cleanupStaleData(List<StaleNamedBlob> staleRecords) {
    return executeGenericTransactionAsync(true, (connection) -> {
      long startTime = this.time.milliseconds();
      for (StaleNamedBlob record : staleRecords) {
        applySoftDeleteWithVersion(record.getAccountId(), record.getContainerId(), record.getBlobName(),
            record.getVersion(), record.getDeleteTs(), connection);
      }
      metricsRecoder.namedBlobCleanupTimeInMs.update(this.time.milliseconds() - startTime);
      return staleRecords.size();
    }, null);
  }
Constructor to create the Metrics.
@param metricRegistry The {@link MetricRegistry}.
ambry-named-mysql/src/main/java/com/github/ambry/named/MySqlNamedBlobDb.java