public static MetricsOptions fromConfiguration(final MetricsConfiguration config) {
    final MetricsOptions metricsOptions = create();
    metricsOptions.unstableOptions.timersEnabled = config.isTimersEnabled();
    metricsOptions.unstableOptions.idleTimeout = config.getIdleTimeout();
    metricsOptions.isMetricsEnabled = config.isEnabled();
    metricsOptions.metricsHost = config.getHost();
    metricsOptions.metricsPort = config.getPort();
    metricsOptions.metricsProtocol = config.getProtocol();
    metricsOptions.metricCategories =
        config.getMetricCategories().stream()
            .map(MetricCategory::getName)
            .collect(toUnmodifiableSet());
    metricsOptions.metricsPrometheusJob = config.getPrometheusJob();
    metricsOptions.isMetricsPushEnabled = config.isPushEnabled();
    metricsOptions.metricsPushHost = config.getPushHost();
    metricsOptions.metricsPushPort = config.getPushPort();
    metricsOptions.metricsPushInterval = config.getPushInterval();

    return metricsOptions;
  }
Returns a newly created {@link MetricsOptions} reversed from the supplied MetricsConfiguration

@param config the metrics configuration
@return a newly created {@link MetricsOptions} reversed from the supplied MetricsConfiguration
app/src/main/java/org/hyperledger/besu/cli/options/MetricsOptions.java