flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-6900) Limit size of indiivual components in DropwizardReporter
Date Mon, 10 Jul 2017 14:50:02 GMT

    [ https://issues.apache.org/jira/browse/FLINK-6900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16080448#comment-16080448
] 

ASF GitHub Bot commented on FLINK-6900:
---------------------------------------

Github user NicoK commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4110#discussion_r126442516
  
    --- Diff: flink-metrics/flink-metrics-dropwizard/src/main/java/org/apache/flink/dropwizard/ScheduledDropwizardReporter.java
---
    @@ -184,7 +188,10 @@ public void notifyOfRemovedMetric(Metric metric, String metricName,
MetricGroup
     	@Override
     	public String filterCharacters(String metricName) {
     		char[] chars = null;
    -		final int strLen = metricName.length();
    +		if (metricName.length() > maxComponentLength) {
    +			log.warn("The metric name component {} exceeded the {} characters length limit and
was truncated.", metricName, maxComponentLength);
    +		}
    +		final int strLen = Math.min(metricName.length(), maxComponentLength);
    --- End diff --
    
    You actually don't need to call `Math.min()` anymore after you already checked the condition
for the warning message. You could thus assign `strLen` yourself.


> Limit size of indiivual components in DropwizardReporter
> --------------------------------------------------------
>
>                 Key: FLINK-6900
>                 URL: https://issues.apache.org/jira/browse/FLINK-6900
>             Project: Flink
>          Issue Type: Improvement
>          Components: Metrics
>    Affects Versions: 1.3.0, 1.4.0
>            Reporter: Chesnay Schepler
>            Assignee: Chesnay Schepler
>             Fix For: 1.4.0, 1.3.2
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message