[ https://issues.apache.org/jira/browse/HDFS-16993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17841812#comment-17841812 ]
ASF GitHub Bot commented on HDFS-16993: --------------------------------------- huangzhaobo99 commented on code in PR #5597: URL: https://github.com/apache/hadoop/pull/5597#discussion_r1582490565 ########## hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java: ########## @@ -2630,6 +2631,28 @@ public int getActiveTransferThreadCount() { @Override // DataNodeMXBean public Map<String, Map<String, Long>> getDatanodeNetworkCounts() { + int maxDisplay = getConf().getInt(DFSConfigKeys.DFS_DATANODE_NETWORKERRORS_DISPLAY_TOPCOUNT, + DFSConfigKeys.DFS_DATANODE_NETWORKERRORS_DISPLAY_TOPCOUNT_DEFAULT); + if (maxDisplay >= 0) { Review Comment: Can we first determine the size of the map? If it is less than N, we can return it directly. > Datanode supports configure TopN DatanodeNetworkCounts > ------------------------------------------------------ > > Key: HDFS-16993 > URL: https://issues.apache.org/jira/browse/HDFS-16993 > Project: Hadoop HDFS > Issue Type: Wish > Affects Versions: 3.3.5 > Reporter: farmmamba > Priority: Major > Labels: pull-request-available > > In our prod environment, we try to collect datanode metrics every 15s through > jmx_exporter. we found the datanodenetworkerror metric generates a lot. > for example, if we have a cluster with 1000 datanodes, every datanode may > generate 999 datanodenetworkerror metrics, and overall datanodes will > generate 1000 multiple 999 = 999000 metrics. This is a very expensive > operation. In most scenarios, we only need the topN of it. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org