code: void enableStatistics(boolean enabled) {
      requireNotClosed();
  
      synchronized (configuration) {
        if (enabled) {
          JmxRegistration.registerMXBean(this, statistics, MBeanType.Statistics);
        } else {
          JmxRegistration.unregisterMXBean(this, MBeanType.Statistics);
        }
        statistics.enable(enabled);
        configuration.setStatisticsEnabled(enabled);
      }
    }
docs: Enables or disables the statistics JMX bean.