flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricRegistryConfiguration.java
/**
	 * Create a metric registry configuration object from the given {@link Configuration}.
	 *
	 * @param configuration to generate the metric registry configuration from
	 * @return Metric registry configuration generated from the configuration
	 */
Create a metric registry configuration object from the given  Configuration.
@param configuration to generate the metric registry configuration from
@return Metric registry configuration generated from the configuration
Create a metric registry configuration object from the given Configuration . @param configuration to generate the metric registry configuration from @return Metric registry configuration generated from the configuration
public static MetricRegistryConfiguration fromConfiguration(Configuration configuration) {
		ScopeFormats scopeFormats;
		try {
			scopeFormats = ScopeFormats.fromConfig(configuration);
		} catch (Exception e) {
			LOG.warn("Failed to parse scope format, using default scope formats", e);
			scopeFormats = ScopeFormats.fromConfig(new Configuration());
		}
		char delim;
		try {
			delim = configuration.getString(MetricOptions.SCOPE_DELIMITER).charAt(0);
		} catch (Exception e) {
			LOG.warn("Failed to parse delimiter, using default delimiter.", e);
			delim = '.';
		}
		final String definedReporters = configuration.getString(MetricOptions.REPORTERS_LIST);
		List<Tuple2<String, Configuration>> reporterConfigurations;
		if (definedReporters == null) {
			reporterConfigurations = Collections.emptyList();
		} else {
			String[] namedReporters = splitPattern.split(definedReporters);
			reporterConfigurations = new ArrayList<>(namedReporters.length);
			for (String namedReporter: namedReporters) {
				DelegatingConfiguration delegatingConfiguration = new DelegatingConfiguration(
					configuration,
					ConfigConstants.METRICS_REPORTER_PREFIX + namedReporter + '.');
				reporterConfigurations.add(Tuple2.of(namedReporter, (Configuration) delegatingConfiguration));
			}
		}
		return new MetricRegistryConfiguration(scopeFormats, delim, reporterConfigurations);
	}
public static MetricRegistryConfiguration fromConfiguration ( Configuration configuration ) { ScopeFormats scopeFormats ; try { scopeFormats = ScopeFormats . fromConfig ( configuration ) ; } catch ( Exception e ) { LOG . warn ( "Failed to parse scope format, using default scope formats" , e ) ; scopeFormats = ScopeFormats . fromConfig ( new Configuration ( ) ) ; } char delim ; try { delim = configuration . getString ( MetricOptions . SCOPE_DELIMITER ) . charAt ( 0 ) ; } catch ( Exception e ) { LOG . warn ( "Failed to parse delimiter, using default delimiter." , e ) ; delim = '.' ; } final String definedReporters = configuration . getString ( MetricOptions . REPORTERS_LIST ) ; List < Tuple2 < String , Configuration > > reporterConfigurations ; if ( definedReporters == null ) { reporterConfigurations = Collections . emptyList ( ) ; } else { String [ ] namedReporters = splitPattern . split ( definedReporters ) ; reporterConfigurations = new ArrayList < > ( namedReporters . length ) ; for ( String namedReporter : namedReporters ) { DelegatingConfiguration delegatingConfiguration = new DelegatingConfiguration ( configuration , ConfigConstants . METRICS_REPORTER_PREFIX + namedReporter + '.' ) ; reporterConfigurations . add ( Tuple2 . of ( namedReporter , ( Configuration ) delegatingConfiguration ) ) ; } } return new MetricRegistryConfiguration ( scopeFormats , delim , reporterConfigurations ) ; }
Create a metric registry configuration object from the given {@link Configuration}.
Create a metric registry configuration object from the given { @link Configuration } .