You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2021/02/09 05:20:26 UTC

[spark] branch branch-3.0 updated: [SPARK-34405][CORE] Fix mean value of timersLabels in the PrometheusServlet class

This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 83f3c2e  [SPARK-34405][CORE] Fix mean value of timersLabels in the PrometheusServlet class
83f3c2e is described below

commit 83f3c2ed25a4a773678fd317ab5bd01f4bfb5427
Author: wyp <wy...@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 <wy...@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 59b863b..ae10997 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-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org