This is an automated email from the ASF dual-hosted git repository. dongjoon pushed a commit to branch branch-3.1 in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.1 by this push: new 7047923 [SPARK-34405][CORE] Fix mean value of timersLabels in the PrometheusServlet class 7047923 is described below commit 7047923abbb392a3573c0269ab3f9233c39865d2 Author: wyp <wyphao.2...@163.com> AuthorDate: Mon Feb 8 21:18:29 2021 -0800 [SPARK-34405][CORE] Fix mean value of timersLabels in the PrometheusServlet class ### What changes were proposed in this pull request? The getMetricsSnapshot method of the PrometheusServlet class has a wrong value, It should be taking the mean value but it's taking the max value. ### Why are the changes needed? The mean value of timersLabels in the PrometheusServlet class is wrong, You can look at line 105 of this class: L105. ``` sb.append(s"${prefix}Mean$timersLabels ${snapshot.getMax}\n") ``` it should be ``` sb.append(s"${prefix}Mean$timersLabels ${snapshot.getMean}\n") ``` ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? ![image](https://user-images.githubusercontent.com/5170878/107313576-cc199280-6acd-11eb-9384-b6abf71c0f90.png) Closes #31532 from 397090770/SPARK-34405. Authored-by: wyp <wyphao.2...@163.com> Signed-off-by: Dongjoon Hyun <dh...@apple.com> (cherry picked from commit a1e75edc39c11e85d8a4917c3e82282fa974be96) Signed-off-by: Dongjoon Hyun <dh...@apple.com> --- .../main/scala/org/apache/spark/metrics/sink/PrometheusServlet.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/org/apache/spark/metrics/sink/PrometheusServlet.scala b/core/src/main/scala/org/apache/spark/metrics/sink/PrometheusServlet.scala index e9c2974..0f8fbd3 100644 --- a/core/src/main/scala/org/apache/spark/metrics/sink/PrometheusServlet.scala +++ b/core/src/main/scala/org/apache/spark/metrics/sink/PrometheusServlet.scala @@ -102,7 +102,7 @@ private[spark] class PrometheusServlet( val snapshot = timer.getSnapshot sb.append(s"${prefix}Count$timersLabels ${timer.getCount}\n") sb.append(s"${prefix}Max$timersLabels ${snapshot.getMax}\n") - sb.append(s"${prefix}Mean$timersLabels ${snapshot.getMax}\n") + sb.append(s"${prefix}Mean$timersLabels ${snapshot.getMean}\n") sb.append(s"${prefix}Min$timersLabels ${snapshot.getMin}\n") sb.append(s"${prefix}50thPercentile$timersLabels ${snapshot.getMedian}\n") sb.append(s"${prefix}75thPercentile$timersLabels ${snapshot.get75thPercentile}\n") --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org