code: private void startMetricsThread() {
      LOG.info("Starting periodic Metrics Emitter thread, frequency = " + METRICS_POLL_INTERVAL);
      this.metricsThread = new DaemonThreadExecutor("tx-metrics") {
        @Override
        public void doRun() {
          txMetricsCollector.gauge("committing.size", committingChangeSets.size());
          txMetricsCollector.gauge("committed.size", committedChangeSets.size());
          txMetricsCollector.gauge("inprogress.size", inProgress.size());
          txMetricsCollector.gauge("invalid.size", invalidArray.length);
        }
  
        @Override
        protected void onShutdown() {
          // perform a final metrics emit
          txMetricsCollector.gauge("committing.size", committingChangeSets.size());
          txMetricsCollector.gauge("committed.size", committedChangeSets.size());
          txMetricsCollector.gauge("inprogress.size", inProgress.size());
          txMetricsCollector.gauge("invalid.size", invalidArray.length);
        }
  
        @Override
        public long getSleepMillis() {
          return METRICS_POLL_INTERVAL;
        }
      };
      metricsThread.start();
    }
docs: Emits Transaction Data structures size as metrics