FlinkMetricContainer { @VisibleForTesting static String getFlinkMetricNameString(MetricKey metricKey) { MetricName metricName = metricKey.metricName(); return metricName.getNamespace() + METRIC_KEY_SEPARATOR + metricName.getName(); } FlinkMetricContainer(RuntimeContext runtimeContext); MetricsContainerImpl getMetricsContainer(String stepName); void registerMetricsForPipelineResult(); void updateMetrics(String stepName, List<MonitoringInfo> monitoringInfos); static final String ACCUMULATOR_NAME; }
@Test public void testMetricNameGeneration() { MetricKey key = MetricKey.create("step", MetricName.named("namespace", "name")); String name = getFlinkMetricNameString(key); assertThat(name, is("namespace.name")); }