[
https://issues.apache.org/jira/browse/HDFS-16917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17691318#comment-17691318
]
ASF GitHub Bot commented on HDFS-16917:
---------------------------------------
xinglin commented on code in PR #5397:
URL: https://github.com/apache/hadoop/pull/5397#discussion_r1112393883
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java:
##########
@@ -1936,4 +1936,20 @@ public static boolean isParentEntry(final String path,
final String parent) {
return path.charAt(parent.length()) == Path.SEPARATOR_CHAR
|| parent.equals(Path.SEPARATOR);
}
+
+ /**
+ * Calculate the transfer rate in megabytes/second. Return -1 for any
negative input.
+ * @param bytes bytes
+ * @param durationMS duration in milliseconds
+ * @return the number of megabytes/second of the transfer rate
+ */
+ public static long transferRateMBs(long bytes, long durationMS) {
+ if (bytes < 0 || durationMS < 0) {
+ return -1;
+ }
+ if (durationMS == 0) {
+ durationMS = 1;
+ }
+ return bytes / (1024 * 1024) * 1000 / durationMS;
Review Comment:
We probably need to change the division to be done based on float/double.
Then return a float/double as well.
> Add transfer rate quantile metrics for DataNode reads
> -----------------------------------------------------
>
> Key: HDFS-16917
> URL: https://issues.apache.org/jira/browse/HDFS-16917
> Project: Hadoop HDFS
> Issue Type: Task
> Components: datanode
> Reporter: Ravindra Dingankar
> Priority: Minor
> Labels: pull-request-available
>
> Currently we have the following metrics for datanode reads.
> |BytesRead
> BlocksRead
> TotalReadTime|Total number of bytes read from DataNode
> Total number of blocks read from DataNode
> Total number of milliseconds spent on read operation|
> We would like to add a new quantile metric calculating the transfer rate for
> datanode reads.
> This will give us a distribution across a window of the read transfer rate
> for each datanode.
> Quantiles for transfer rate per host will help in identifying issues like
> hotspotting of datasets as well as finding repetitive slow datanodes.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]