Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[minor] when metric prefix length is 0 ignore the metric prefix #10190

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.hudi.common.model.HoodieCommitMetadata;
import org.apache.hudi.common.table.timeline.HoodieTimeline;
import org.apache.hudi.common.util.Option;
import org.apache.hudi.common.util.StringUtils;
import org.apache.hudi.common.util.VisibleForTesting;
import org.apache.hudi.common.util.collection.Pair;
import org.apache.hudi.config.HoodieWriteConfig;
Expand Down Expand Up @@ -340,7 +341,14 @@ public void updateIndexMetrics(final String action, final long durationInMs) {

@VisibleForTesting
public String getMetricsName(String action, String metric) {
return config == null ? null : String.format("%s.%s.%s", config.getMetricReporterMetricsNamePrefix(), action, metric);
if (config == null) {
return null;
}
if (StringUtils.isNullOrEmpty(config.getMetricReporterMetricsNamePrefix())) {
return String.format("%s.%s", action, metric);
} else {
return String.format("%s.%s.%s", config.getMetricReporterMetricsNamePrefix(), action, metric);
}
}

public void updateClusteringFileCreationMetrics(long durationInMs) {
Expand Down
Loading